TensorFlow+Keras
dongapple
这个作者很懒,什么都没留下…
展开
-
Keras入门mnist_mlp.py
from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import SGD from keras.datasets import mnist import numpy model = Sequential(原创 2017-08-17 20:43:18 · 709 阅读 · 0 评论 -
Keras默认使用的后端模式(Theano/TensorFlow)设置
其实就是在C:\Users\75538(75538是我的windos用户名字,找你对应的用户名就行)下有个文件夹.keras,里面有keras.json文件,改一下里面的内容就好了,如果没有文件夹和文件,手动创建就行。 用theano的话,keras.json写入 { "image_dim_ordering": "th", "epsilon": 1e-07, "原创 2017-08-22 11:12:34 · 1384 阅读 · 0 评论 -
Keras模型的加载和保存、预训练、按层名匹配参数
我们不推荐使用pickle或cPickle来保存Keras模型 你可以使用model.save(filepath)将Keras模型和权重保存在一个HDF5文件中,该文件将包含: 模型的结构,以便重构该模型模型的权重训练配置(损失函数,优化器等)优化器的状态,以便于从上次训练中断的地方开始 使用keras.models.load_model(filepath)来重新实例化你的模型,转载 2017-08-24 15:05:14 · 9826 阅读 · 3 评论