Skip to Content
Deep Learning Quick Reference
book

Deep Learning Quick Reference

by Mike Bernico
March 2018
Intermediate to advanced
272 pages
7h 53m
English
Packt Publishing
Content preview from Deep Learning Quick Reference

Putting it all together

Now that we've covered the individual pieces, let's take a look at our overall network. This looks similar to the models we've previously covered in the book. However, we're using the loss function categorical_crossentropy, which we covered in the Cost function section of this chapter.

We will define our network using the following code:

def build_network(input_features=None):    # first we specify an input layer, with a shape == features    inputs = Input(shape=(input_features,), name="input")    x = Dense(512, activation='relu', name="hidden1")(inputs)    x = Dense(256, activation='relu', name="hidden2")(x)    x = Dense(128, activation='relu', name="hidden3")(x)    prediction = Dense(10, activation='softmax', name="output")(x)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Keras Deep Learning Cookbook

Keras Deep Learning Cookbook

Rajdeep Dua, Sujit Pal, Manpreet Singh Ghotra
Deep Learning with Keras

Deep Learning with Keras

Antonio Gulli, Sujit Pal

Publisher Resources

ISBN: 9781788837996Supplemental Content