October 2018
Intermediate to advanced
472 pages
10h 57m
English
The following are some of the hyperparameters that we will be using throughout our code. These are totally configurable:
# Number of epochsepochs = 20# Batchsizebatch_size = 128# Optimizer for the generatorfrom keras.optimizers import Adamoptimizer = Adam(lr=0.0001)# Shape of the input imageinput_shape = (28,28,1)
If you look back at Chapter 2, Training NN for Prediction Using Regression, you'll see that the optimizer used there was Adam. Therefore, we will import the Adam optimizer from the keras module and set its learning rate, as shown in the preceding code. For most cases that will follow, we will be training for 20 epochs for ease of comparison.
Read now
Unlock full access