October 2017
Intermediate to advanced
330 pages
7h 7m
English
import numpy as npimport scipy.iofrom matplotlib import pyplot as pltfrom keras.utils import np_utilsfrom keras.models import Sequential, Input, Modelfrom keras.layers.core import Dense, Dropout, Activation, Reshape, Flatten, Lambdafrom keras.layers import Conv2D, MaxPooling2D, UpSampling2Dfrom keras.callbacks import EarlyStopping
mat = scipy.io.loadmat('Data/train_32x32.mat')mat = mat['X']b, h, d, n = mat.shape
#Convert all RGB-Images to greyscaleimg_gray = np.zeros(shape =(n, b, h, 1))def rgb2gray(rgb): return np.dot(rgb[...,:3], ...
Read now
Unlock full access