October 2018
Intermediate to advanced
472 pages
10h 57m
English
This module implements the training and evaluation of a convolution classifier with the pooling operation:
"""This module implements a convolution classifier with maxpool operation."""import numpy as npfrom keras.datasets import mnistfrom keras.models import Sequentialfrom keras.layers import Dense, Conv2D, Flatten, MaxPool2Dimport matplotlib.pyplot as pltfrom sklearn.model_selection import train_test_splitfrom loss_plot import loss_plot# 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)(X_train, y_train), (X_test, y_test) = mnist.load_data()X_train, X_val, y_train, ...
Read now
Unlock full access