我们以MNIST手写数字识别为例 import numpy as np from keras.datasets import mnist from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense from keras.optimizers import SGD # 载入数据 (x_train,y_train),(x_test,y_test) = mnist…