April 2017
Beginner to intermediate
358 pages
9h 30m
English
We will now build the convolutional neural network. I have performed some tinkering and found a layout that works well, but feel free to experiment with more layers (or fewer), layers of different types and different sizes. Smaller networks train faster, but larger networks can achieve better results.
First, we create the layers of our neural network:
from keras.layers import Dense, Flatten, Convolution2D, MaxPooling2Dconv1 = Convolution2D(32, 3, 3, input_shape=(d, h, w), activation='relu')pool1 = MaxPooling2D()conv2 = Convolution2D(64, 2, 2, activation='relu')pool2 = MaxPooling2D()conv3 = Convolution2D(128, 2, 2, activation='relu')pool3 = MaxPooling2D()flatten = Flatten()hidden4 = Dense(500, activation='relu') ...
Read now
Unlock full access