October 2018
Intermediate to advanced
472 pages
10h 57m
English
This module implements the training and evaluation of a deep convolution classifier on augmented data:
"""This module implements a deep conv classifier on augmented data."""import numpy as npfrom keras.datasets import mnistfrom keras.models import Sequentialfrom keras.layers import Dense, Conv2D, Flatten, MaxPool2D, Dropoutimport matplotlib.pyplot as pltfrom keras.preprocessing.image import ImageDataGeneratorfrom sklearn.model_selection import train_test_splitfrom loss_plot import loss_plot# Number of epochsepochs = 10# Batchsizebatch_size = 128# Optimizer for the generatorfrom keras.optimizers import Adamoptimizer = Adam(lr=0.001)# Shape of the input imageinput_shape = (28,28,1)(X_train, y_train), (X_test, y_test) ...
Read now
Unlock full access