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

CartPole neural network architecture

Three hidden layers with 16 neurons each is really probably more than enough to solve this simple problem. This model closely resembles some of the basic models we used in the beginning of the book. We will use the following code to define the model:

def build_model(state_size, num_actions):    input = Input(shape=(1,state_size))    x = Flatten()(input)    x = Dense(16, activation='relu')(x)    x = Dense(16, activation='relu')(x)    x = Dense(16, activation='relu')(x)    output = Dense(num_actions, activation='linear')(x)    model = Model(inputs=input, outputs=output)    print(model.summary())    return model

The input will be a 1 x state space vector and there will be an output neuron for each possible action that will predict ...

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