在colab上加载minst数据集 ``
// An highlighted block
import numpy as np
from keras.datasets import mnist
from keras.models import Sequential,Model
from keras.layers.core import Dense,Activation,Dropout
from keras.utils import np_utils
import matplotlib.pyplot as plt
import matplotlib.image as processimage
#load mnist RAW dataset拉取原始数据
(X_train,Y_train),(X_test,Y_test)=mnist.load_data()
print(X_train.shape,Y_train.shape)
print(X_test.shape,Y_test.shape)
#准备数据
#因为使用的是全连接层,不认识矩阵,只认识向量
#所以需要把数据准备成神经网络需要的数据
X_train = X_train.reshape(60000,28*28)
X_test = X_test.reshape(10000,28*28)
参考:
https://blog.csdn.net/qq_36281420/article/details/105916040?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163074426716780265470782%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=163074426716780265470782&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~rank_v29_ecpm-1-105916040.first_rank_v2_pc_rank_v29&utm_term=colab%E5%8A%A0%E8%BD%BDminst&spm=1018.2226.3001.4187