--- title: Keras Model composed of a linear stack of layers type: docs repo: https://github.com/rstudio/keras menu: main: name: Keras Model composed of a linear stack of layers - keras parent: keras-reference aliases: - /reference/keras/keras_model_sequential.html - /keras/reference/keras_model_sequential.html - /guide/keras/reference/keras_model_sequential.html - /tools/tools/keras/reference/keras_model_sequential.html - /installation/keras/reference/keras_model_sequential.html - /tutorials/keras/reference/keras_model_sequential.html - /guide/tools/keras/reference/keras_model_sequential.html - /deploy/keras/reference/keras_model_sequential.html - /tools/keras/reference/keras_model_sequential.html - /tutorials/tools/keras/reference/keras_model_sequential.html ---
Keras Model composed of a linear stack of layers
keras_model_sequential(layers = NULL, name = NULL)
| layers | List of layers to add to the model |
| name | Name of model |
The first layer passed to a Sequential model should have a defined input
shape. What that means is that it should have received an input_shape
or
batch_input_shape
argument, or for some type of layers (recurrent,
Dense...) an input_dim
argument.
Other model functions:
compile.keras.engine.training.Model()
,
evaluate.keras.engine.training.Model()
,
evaluate_generator()
,
fit.keras.engine.training.Model()
,
fit_generator()
,
get_config()
,
get_layer()
,
keras_model()
,
multi_gpu_model()
,
pop_layer()
,
predict.keras.engine.training.Model()
,
predict_generator()
,
predict_on_batch()
,
predict_proba()
,
summary.keras.engine.training.Model()
,
train_on_batch()
if (FALSE) {
library(keras)
model <- keras_model_sequential()
model %>%
layer_dense(units = 32, input_shape = c(784)) %>%
layer_activation('relu') %>%
layer_dense(units = 10) %>%
layer_activation('softmax')
model %>% compile(
optimizer = 'rmsprop',
loss = 'categorical_crossentropy',
metrics = c('accuracy')
)
}


Tabs example
1st tab
2nd tab
3rd tab
4th tab
here the content of 1st tab
here the content of 2nd tab
here the content of 3rd tab, with a select with an id="id_in_tab"
1241
here the content of 4th tab
Other
Other other
plop
other
toto
other other


Module Name: MultiSelectModule
Module Name: MultiSelectModule
MultiSelect is a component where exists a list of itens to search and select like tags.
TWO
ways to use MultiSelect, the first one is using an Simple Array of Objects
, passing only the data that
you want to. For Example:Complex Array of Objects
where you must
must pass a pattern to the component.
The Keys [source]
and [effect]
. In this case you can personalize each tag. For Example: Note: The Keys inside those objects can be custom, referenced through the properties.


--- title: 100 Days of Codee 2020 kind: article created_at: 2020-04-10 preview_image: --- <% content_for(:comic) do %> <% end %> <% content_for(:newspost) do %>
I've wanted to get back into coding more and actually turning some of my ideas into actual things. What better time than while in quarantine? So here is my running list of these #100DaysOfCode.


Mindset: Fairly clean. I feel somewhat confused about where I am in life, but up to the challenge of entering the Mushroom world for a night to see where it takes me.
Setting: A large house that was never left during the trip. Music was always on, the progression was 3 orb cds (Orblivion, Ultraworld 1, Ultraworld 2) and then some floyd (The Wall, Animals I think). Cold night, everyone stayed in. Numerous sober, or at least non tripping, people were present all night.
Three quarters of an ounce of mushrooms were obtained, and distributed equally to myself, and 5 other people who I will refer to as A, J, E, L, and T. The mushrooms were of higher quality than many I have had, as I was to find out, although there were more stems than caps. Of our group, I had the greatest amount of psychedellic experience, having taken reckless amounts of LSD in high school, although it was several years after that that I fist allowed myself to take 'shrooms last year. Every other member of our group had tripped at least once or twice, though. An hour before eating the shrooms I smoked a fair amount of good pot and got reasonably high.
At 6:30, everyone but L ate their mushrooms. Other people elected to slam them down or eat them on pizza because they tasted strongly bitter, but I chewed mine carefully and held the debris in my gums, which paid off. 30 minutes later, when we had descended into the living room that would be our home for the next 6 hours or so, I was already starting to trip out.
7:00: A joint is discussed, but people decide to wait and see where the shrooms are going to lead us. The room has a fog machine, light projector and laser projector in it and begins to assume bizarre, warm aspects for me. From here on out, my ability to tell time becomes very distorted. I stumble through a sentence, and have to stop and say, 'Heh, there it is.
Withing fifteen minutes, people are making the kind of giggly observations so common with the 'coming up' period. However, quite quickly I realize that I'm in for a stronger trip than I had pictured, and I grow quiet and somewhat withdrawn. This seems to be widespread among our group. L arrives and eats his dose. One of our sitters comments 'This has to be the quietest group of trippers I've ever seen', and another laments 'You guys are supposed to be entertaining me!' This brings me back to earth for a minute, and I say, 'No, you have the dichotomy reversed, you're supposed to be entertain us!' and giggle about it for a bit. I am now in the grip of the mushrooms. Closing my eyes brings a geometeric plane of dancing patterns and shapes, but it feels 'empty' to me. I realize that I have been here before, but last time there was a 'tower' of personally significant information in this space, and it's missing.
I realize that A has been missing for quite some time. Someone comes down from upstairs and says 'there's a kid laying down in the hall upstairs'. J goes up, and an indeterminate time later, they return. I assume that A was the person laying in the hall, and ask, 'Where have you been?' He said, 'I took a wrong turn. I went around a bend, and it got a little bad, but it's better now.' A sitter asks us how we feel, I giggle and E says 'I feel really good.'  I do terribly, and the increased lighting makes me nervous. The balls seem to be made of solid color with no shading at all, and it's the purest colors, the colors of childhood. But the light grates on me, and I return to the 'trip room' downstairs.
9:30 (T+3:00): I realize that I have to go to the bathroom, so I walk down the hall. Someone calls me on my phone, I have a brief and confused conversation with them. Suddenly I feel faint. I am about to pass out, I am scared, I sit down, it's dark, I am in hell, this will never end. With this feeling comes an immense need to vomit, so I go to the bathroom and sit down by the toilet. I rip off my outer layers, and realize that I am covered in sweat. But suddenly the naseau subsides, the blackening of my vision ceases, and I feel reborn: I feel like whatever doubts I have about the existance of a god have just been squashed, because I am aware that I'm back in my own body, and damn if it isn't such a bad place after all.
J and T have come to check on me and make sure that I'm not freaking out or dying in the bathroom, which also makes me feel safer and good. The bathroom floor is a tiled, hexagonal affair, and the tiles seem to be moving, shifting, becoming 3d, typical 'tryptamine visuals', like acid visuals except more 'organic' feeling. Instead of hard lines, everything is surrounded by a soft, easy glow. I sit down on a carpet, and start talking to a group of non-trippers who have come to the house after an aborted effort to ride the 'drunk bus' (bus that goes to a club) to Toronto. T approaches me, asks if I am feeling better. I say that I am. He seems a little nervous himself, in fact he seemed relieved when I told him I'd felt lightheaded, because he was feeling the same way. He asks me to come back to the 'trip room', or if I want to, and it sounds warm and trippy and nice.
I return to the 'trip room' and basically decide to just wait for the mushrooms to wear off. I was unsettled enough by what happened in the bathroom to worry about the rest of the trip being sour, but I manage to keep things under control, and today I feel that that sense of 'coming home' and really 'belonging' in my own body was well worth the negativity and fear-of-death. For the whole night, L has been especially quiet. I say, '(L), are you okay?' He says, 'Better now. The shrooms are wearing off.' I ask him the same question about a half hour later, and get the same response.
By 10:30, it seems to me that everyone is leveling off. Some more cannibus is smoked, and I just 'chill' and watch the laser patterns on the wall become three dimensional. There's a kitten present who goes nuts over the laser, much to our enjoyment.
At 11:30, J or E turn on the TV. After a brief cable outage, we just watch Comedy Central for about an hour and a half. By the time this period is over, some people have gone to bed, and L offers to drive me home. Since I personally have felt quite sober for at least an hour, we only have 5 blocks to go, and L hasn't had any pot, I decide to take a ride instead of walk in the 30 degree Upstate NY weather. When L drops me off, we talk a little about the expirience. I say, 'Yes, well, I had a bit of a difficult experience myself, and I need some time to think about and integrate that, but I will.' L says, 'Difficult? How so?' and I reply that I feel out of touch with who I am, where I'm going in my life, and what I want to do, and the mushrooms drove home to me that though I feel at home in my body, I need to feel at home in in my life, too. L expresses that perhaps some of the same doubts were behind his silent, troubled trip.
All in all, I think this was a positive experience, although I haven't talked to A yet about the 'wrong turn' he took. It was a rather subdued, quiet experience, but for me aty least it provided a good springboard for introspection and highlighted some of the things I need to be thinking about and working towards. The negative aspects, however, have made me decide that I may not enter the Mushroom world again until I'm in a different place with what I'm doing and how I feel, or else I suspect I would have very much the same trip again.
As a side note, I had considered taking a quarter ounce because the last batch I ate were weak: this would have almost certainly resulted in an unmanagable expirience for me. Mushroom quality varies wildly, at least around here, and I think it's a bad idea to take more than an eighth-ounce unless one takes a smaller dose of the same batch first to evaluate potency. This is probably smart drug common sense, but I feel that it's worth highlighting, as the lingering anxiety and fear that kept threatening to push the trip into the Hell Bardos would certainly have been able to do so on a stronger dose.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Advice and answers from the Bonjoro Team
search
Get Started with Bonjoro
How to setup Bonjoro and send your first message
7 articles in this collection
Written by
Amy Habib
and
Grant Dewar
Get Started with Bonjoro
How to setup Bonjoro and send your first message
7 articles in this collection
Written by
Amy Habib
and
Grant Dewar
Get Started with Bonjoro
How to setup Bonjoro and send your first message
7 articles in this collection
Written by
Amy Habib
and
Grant Dewar
chat_bubble


Board
Pattern
Pattern Mode
Load and Save
Board Size
Survive Rules
Revive Rules
Animation Speed
View
Cell Mode
Zoom Sensitivity
Generation
Displaying # 0
About
This website requires JavaScript to do anything interesting.
Board
Pattern
Pattern Mode
Load and Save
Board Size
Survive Rules
Revive Rules
Animation Speed
View
Cell Mode
Zoom Sensitivity
Generation
Displaying # 0
About


|
| def | flip (self) |
| |
|
def | flip (self, val) |
| |
| def | packing (self) |
| |
|
def | packing (self, val) |
| |
| def | pad (self) |
| |
|
def | pad (self, val) |
| |
| def | squarifyratio (self) |
| |
|
def | squarifyratio (self, val) |
| |
| def | __init__ (self, arg=None, flip=None, packing=None, pad=None, squarifyratio=None, **kwargs) |
| |
◆ __init__()
| def plotly.graph_objs.treemap.Tiling.__init__ |
( |
|
self, |
|
|
|
arg = None , |
|
|
|
flip = None , |
|
|
|
packing = None , |
|
|
|
pad = None , |
|
|
|
squarifyratio = None , |
|
|
** |
kwargs |
|
) |
| |
Construct a new Tiling object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of plotly.graph_objs.treemap.Tiling
flip
Determines if the positions obtained from solver are
flipped on each axis.
packing
Determines d3 treemap solver. For more info please
refer to https://github.com/d3/d3-hierarchy#treemap-
tiling
pad
Sets the inner padding (in px).
squarifyratio
When using "squarify" `packing` algorithm, according to
https://github.com/d3/d3-hierarchy/blob/master/README.m
d#squarify_ratio this option specifies the desired
aspect ratio of the generated rectangles. The ratio
must be specified as a number greater than or equal to
one. Note that the orientation of the generated
rectangles (tall or wide) is not implied by the ratio;
for example, a ratio of two will attempt to produce a
mixture of rectangles whose width:height ratio is
either 2:1 or 1:2. When using "squarify", unlike d3
which uses the Golden Ratio i.e. 1.618034, Plotly
applies 1 to increase squares in treemap layouts.
Returns
-------
Tiling
◆ flip()
| def plotly.graph_objs.treemap.Tiling.flip |
( |
|
self | ) |
|
Determines if the positions obtained from solver are flipped on
each axis.
The 'flip' property is a flaglist and may be specified
as a string containing:
- Any combination of ['x', 'y'] joined with '+' characters
(e.g. 'x+y')
Returns
-------
Any
◆ packing()
| def plotly.graph_objs.treemap.Tiling.packing |
( |
|
self | ) |
|
Determines d3 treemap solver. For more info please refer to
https://github.com/d3/d3-hierarchy#treemap-tiling
The 'packing' property is an enumeration that may be specified as:
- One of the following enumeration values:
['squarify', 'binary', 'dice', 'slice', 'slice-dice',
'dice-slice']
Returns
-------
Any
◆ pad()
| def plotly.graph_objs.treemap.Tiling.pad |
( |
|
self | ) |
|
Sets the inner padding (in px).
The 'pad' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
◆ squarifyratio()
| def plotly.graph_objs.treemap.Tiling.squarifyratio |
( |
|
self | ) |
|
When using "squarify" `packing` algorithm, according to https:/
/github.com/d3/d3-hierarchy/blob/master/README.md#squarify_rati
o this option specifies the desired aspect ratio of the
generated rectangles. The ratio must be specified as a number
greater than or equal to one. Note that the orientation of the
generated rectangles (tall or wide) is not implied by the
ratio; for example, a ratio of two will attempt to produce a
mixture of rectangles whose width:height ratio is either 2:1 or
1:2. When using "squarify", unlike d3 which uses the Golden
Ratio i.e. 1.618034, Plotly applies 1 to increase squares in
treemap layouts.
The 'squarifyratio' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
The documentation for this class was generated from the following file:
- C:/Users/Nathan/Documents/SP20/Software Engineering/plotly.py/packages/python/plotly/plotly/graph_objs/treemap/__init__.py


Recipe 13.5. Sending HTML MailCredit: Art Gillespie ProblemYou need to send HTML mail and accompany it with a plain text version of the message's contents, so that the email message is also readable by MUAs that are not HTML-capable. SolutionAlthough the modern Python way to perform any mail manipulation is with the standard Python library email package, the functionality we need for this recipe is also supplied by the MimeWriter and mimetools modules (which are also in the Python Standard Library). We can easily code a function that just accesses and uses that functionality: def createhtmlmail(subject, html, text=None): " Create a mime-message that will render as HTML or text, as appropriate" import MimeWriter, mimetools, cStringIO if text is None: # Produce an approximate textual rendering of the HTML string, # unless you have been given a better version as an argument import htmllib, formatter textout = cStringIO.StringIO( ) formtext = formatter.AbstractFormatter(formatter.DumbWriter(textout)) parser = htmllib.HTMLParser(formtext) parser.feed(html) parser.close( ) text = textout.getvalue( ) del textout, formtext, parser out = cStringIO.StringIO( ) # output buffer for our message htmlin = cStringIO.StringIO(html) # input buffer for the HTML txtin = cStringIO.StringIO(text) # input buffer for the plain text writer = MimeWriter.MimeWriter(out) # Set up some basic headers. Place subject here because smtplib.sendmail # expects it to be in the message, as relevant RFCs prescribe. writer.addheader("Subject", subject) writer.addheader("MIME-Version", "1.0") # Start the multipart section of the message. Multipart/alternative seems # to work better on some MUAs than multipart/mixed. writer.startmultipartbody("alternative") writer.flushheaders( ) # the plain-text section: just copied through, assuming iso-8859-1 subpart = writer.nextpart( ) pout = subpart.startbody("text/plain", [("charset", 'iso-8859-1')]) pout.write(txtin.read( )) txtin.close( ) # the HTML subpart of the message: quoted-printable, just in case subpart = writer.nextpart( ) subpart.addheader("Content-Transfer-Encoding", "quoted-printable") pout = subpart.startbody("text/html", [("charset", 'us-ascii')]) mimetools.encode(htmlin, pout, 'quoted-printable') htmlin.close( ) # You're done; close your writer and return the message as a string writer.lastpart( ) msg = out.getvalue( ) out.close( ) return msg DiscussionThis recipe's module is completed in the usual style with a few lines to ensure that, when run as a script, it runs a self-test by composing and sending a sample HTML mail: if _ _name_ _=="_ _main_ _": import smtplib f = open("newsletter.html", 'r') html = f.read( ) f.close( ) try: f = open("newsletter.txt", 'r') text = f.read( ) except IOError: text = None subject = "Today's Newsletter!" message = createhtmlmail(subject, html, text) server = smtplib.SMTP("localhost"<EMAIL_ADDRESS><EMAIL_ADDRESS>message) server.quit( ) Sending HTML mail is a popular concept, and (as long as you avoid sending it to newsgroups and open mailing lists) there's no reason your Python scripts shouldn't do it. When you do send HTML mail, never forget to embed a text-only version of your message along with the HTML version. Lots of folks still prefer character-mode mail readers (technically known as MUAs), and it makes no sense to alienate those users by sending mail that they can't conveniently read. This recipe shows how easy Python makes the task of sending an email in both HTML and text forms. Ideally, your input will be a properly formatted text version of the message, as well as the HTML version. But, if you don't have such nice textual input, you can still prepare a text version on the fly starting from the HTML version; one way to prepare such text is shown in the recipe. Remember that htmllib has some limitations, so you may want to use alternative approaches, such as saving the HTML string to disk and then using: text = os.popen('lynx -dump %s' % tempfile).read( ) or whatever works best for you. Alternatively, if all you have as input is plain text (following some specific conventions, such as empty lines to mark paragraphs and underlines for emphasis), you can parse the text and throw together some HTML markup on the fly. The emails generated by this code have been successfully read on Outlook 2000, Eudora 4.2, Hotmail, and Netscape Mail. It's likely that they will work in other HTML-capable MUAs as well. Mutt has been used to test the acceptance of messages generated by this recipe in text-only MUAs. Again, other such MUAs can be expected to work just as acceptably. See AlsoRecipe 13.6 shows how the email package in the Python Standard Library can also be used to compose a MIME multipart message; documentation in the Library Reference and Python in a Nutshell about the standard library package email, as well as modules mimetools, MimeWriter, htmllib, formatter, cStringIO, and smtplib; Henry Minsky's article about MIME (http://www.arsdigita.com/asj/mime/) for information on various issues related to sending HTML mail. |


Previous Demo
Back to the Codrops Article
Drag and Drop Interaction Ideas
Inspiration for drag and drop interactions for the modern UI
Bottom Area
Sidebar
Page Scale
Modal
Icons
Bottom Slide
Reveal
If you enjoyed this demo you might also like:
Draggable Dual-View Slideshow
Morphing Buttons Concept


Favourite Cartoon Character
First Name
Last Name
Birthday
Favourite Channel:
Go to
Cartoon Network
or
Disney Channel
to watch your favourite shows now!


PixieDust comes with sample data. To start playing with the display() API and other PixieDust features, load and then visualize one of our many sample data sets.
To call the list of data sets, run the following command in your notebook:
pixiedust.sampleData()
You get a list of the data sets included with PixieDust.
NoteIf you get an error, and you're running Spark 1.6, run the following command to manually install packages missing in 1.6 (You need to do so only once.):
pixiedust.installPackage("com.databricks:spark-csv_2.10:1.5.0") pixiedust.installPackage("org.apache.commons:commons-csv:0")
To create a pySpark DataFrame for one of the samples, just enter its number in the following command. For example, to load Set 6, Million Dollar Home sales, run the command:
home_df = pixiedust.sampleData(6)
You can also replace the number with a URL. If you have a CSV file online, access it by entering the URL in the parentheses, like this:
home_df = pixiedust.sampleData("https://openobjectstore.mybluemix.net/misc/milliondollarhomes.csv")
Loading a CSV from your local file system is equally simple. Drop in the file path, like so:
pixiedust.sampleData('file:///Users/bradfordnoble/pixiedust/data/nz.csv')
PixieDust provides these sample data sets as a convenience to help you get started fast. To load or connect to your own data source, follow the steps you normally would from within a notebook. Our team has created some notebook tutorials which show how to connect to Cloudant, Twitter, and other data sources. See: Predict Flight Delays with Apache Spark MLLib, FlightStats, and Weather Data and Sentiment Analysis of Twitter Hashtags


Opps. We have encounter an error! Please try again!