keras学习,理解其中的关键。
步骤
- 数据
- 模型定义
- 模型训练
- 模型评测
- 模型保存
- 模型调参
数据
# data
from keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = [x.reshape(x.shape[0], -1) / 255 for x in (x_train, x_test)]
import numpy as np
x_train, x_test = [np.expand_dims(x, 2) for x in (x_train, x_test)]
x_train.shape, x_test.shape
1598



被折叠的 条评论
为什么被折叠?



