1
使用Keras重塑数据以进行深度学习
我是Keras的初学者,我从MNIST示例开始,以了解库的实际工作方式。Keras示例文件夹中MNIST问题的代码段为: import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Convolution2D, MaxPooling2D from keras.utils import np_utils batch_size = 128 nb_classes = 10 nb_epoch = 12 # input image dimensions img_rows, img_cols = 28, …