import numpy as np import cPickle import keras as ks from keras.layers import Dense, Activation, Flatten, convolutional, Convolution2D, MaxPooling2D, Dropout from keras.utils import np_utils import logging def read_data(file): with open(file,'rb') as…