深度GoogLeNet与ResNet在图像分类中的应用
1. 深度GoogLeNet在Tiny ImageNet上的训练
在Tiny ImageNet数据集上训练深度GoogLeNet时,我们会使用L2正则化强度为0.0002以及Adam优化器。若要从特定epoch重新开始训练,需要加载模型并调整学习率,代码如下:
# otherwise, load the checkpoint from disk
else:
print("[INFO] loading {}...".format(args["model"]))
model = load_model(args["model"])
# update the learning rate
print("[INFO] old learning rate: {}".format(
K.get_value(model.optimizer.lr)))
K.set_value(model.optimizer.lr, 1e-5)
print("[INFO] new learning rate: {}".format(
K.get_value(model.optimizer.lr)))
接着,我们创建两个回调函数,一个用于每五个epoch将模型权重序列化到磁盘,另一个用于创建损失/准确率随时间变化的图表:
# construct the set of callbacks
callbacks = [
E
超级会员免费看
订阅专栏 解锁全文

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



