April 2017
Intermediate to advanced
320 pages
7h 46m
English
The core data structure of Keras is a model, which is a way to organize layers. There are two types of model:
You define a sequential model as follows:
from keras.models import Sequentialmodel = Sequential()
Once a model is defined, you can add one or more layers. The stacking operation is provided by the add() statement:
from keras.layers import Dense, Activation
For example, add a first fully connected NN layer and the Activation function:
model.add(Dense(output_dim=64, input_dim=100))model.add(Activation("relu"))
Then add a second softmax layer:
model.add(Dense(output_dim=10)) ...
Read now
Unlock full access