October 2018
Intermediate to advanced
252 pages
6h 49m
English
The following code creates a Sequential model with two Dense layers:
from keras.models import Sequentialfrom keras.layers import Densefrom keras.utils.vis_utils import plot_modelmodel = Sequential()model.add(Dense(16, input_dim=1, activation='relu'))model.add(Dense(16, activation='sigmoid'))print(model.summary())
Keras provides the ability to summarize using the summary() method:
Using TensorFlow backend._________________________________________________________________Layer (type) Output Shape Param # =================================================================dense_1 (Dense) (None, 16) 32 _________________________________________________________________dense_2 (Dense) (None, 16) 272 ================================================================= ...