January 2019
Intermediate to advanced
386 pages
11h 13m
English
In the third chapter, we introduced a simple neural network to classify digits using Keras and we got 96% accuracy. We could improve this with some tricks (more hidden neurons, for example), but let's try with a simple CNN instead:
# for reproducibilityfrom numpy.random import seedseed(1)from tensorflow import set_random_seedset_random_seed(1)
from keras.datasets import mnistfrom keras.models import Sequentialfrom keras.layers import Dense, Activationfrom keras.layers import Convolution2D, MaxPooling2Dfrom ...