description: simple CNN example for MNIST dataset
import packages
1 | import numpy |
fix random seed for reproducibility
1 | seed = 7 |
load data
1 | (X_train, y_train), (X_test, y_test) = mnist.load_data() |
normalize inputs from 0-255 to 0-1
1 | X_train = X_train / 255 |
define baseline model
1 | def baseline_model(): |
define model
1 | # build the model |
output
1 | Train on 60000 samples, validate on 10000 samples |