July 2017
Intermediate to advanced
382 pages
9h 13m
English
Once we have preprocessed the data, it is time to define the actual model. Here, we will once again rely on the Sequential model to define a feedforward neural network:
In [5]: from keras.model import Sequential... model = Sequential()
However, this time, we will be smarter about the individual layers. We will design our neural network around a convolutional layer, where the kernel is a 3 x 3 pixel two-dimensional convolution:
In [6]: from keras.layers import Convolution2D... n_filters = 32... kernel_size = (3, 3)... model.add(Convolution2D(n_filters, kernel_size[0], kernel_size[1],... border_mode='valid',... input_shape=input_shape))
Read now
Unlock full access