1.1 Keras是什么
Keras是基于Theano的一个深度学习框架,它的设计参考了Torch,用Python语言编写,是一个高度模块化的神经网络库,支持GPU和CPU。
1.2 update的方式pk,mini batch vs stochastic gradient descent
1.2.1 mini batch
batch:example被分为mini-batch的大小,每一个mini-batch会让modern updata一次。
epoch:所有batch都运行一次之后,就是一个epoch。

1.2.2 stochastic gradient descent
即是keras=1的mini-batch。
如果有GPU,那么batch_size越大,运算得越快。但是batch_size太大,可以会遇到计算机内存不够,不能并行运算的情况。

2.keras基本流程
以手写数字识别为例:
1. 定义网络结构

2. 设定损失函数的形式

3. 模型拟合

4.模型应用:

网友评论