caffe之cifar10_quick_solver.prototxt详解

参考:blog.csdn.net/u010417185/article/details/52182833(先)
www.cnblogs.com/wm123/p/5462728.html中有对动量等参数的解释
blog.csdn.net/u012938704/article/details/52739612解释的也很好



# reduce the learning rate after 8 epochs (4000 iters) by a factor of 10,本身有50000个训练样本,batch_size=100(一次训练的图片数量,用100张图片的平均损失去更新权重),则需要迭代500次才可以包含所有样本(叫做一个epoch),所以8个epochs就是4000次迭代(每次迭代都是对权重的一种更新)
# The train/test net protocol buffer definition
net: "examples/cifar10/cifar10_quick_train_test.prototxt"#其中测试的batch_size指的是每次测试测试多少张图片
# test_iter specifies how many forward passes the test should carry out.
# In the case of MNIST, we have test batch size 100 and 100 test iterations,
# covering the full 10,000 testing images.
test_iter: 100#10000张图片要测试100次才可以,因为batch_size = 100
# Carry out testing every 500 training iterations.
test_interval: 500#训练500次才测试一次,测100张图片由此可见得与batch_size都计算好才行
# The base learning rate, momentum and the weight decay of the network.
base_lr: 0.0001#基础学习率
momentum: 0.9#动量
weight_decay: 0.004
# The learning rate policy
lr_policy: "fixed"
# Display every 100 iterations
display: 100#其中,每迭代100次,显示一次训练时的lr(学习率)和loss(训练损失)
# The maximum number of iteration
max_iter: 5000
# snapshot intermediate results
snapshot: 5000
snapshot_format: HDF5#默认为BINARYPROTO
snapshot_prefix: "examples/cifar10/cifar10_quick"
# solver mode: CPU or GPU
solver_mode: GPU



solver算是caffe的核心的核心,它协调着整个模型的运作。caffe程序运行必带的一个参数就是solver配置文件。运行代码一般为:

# caffe train --solver=*_slover.prototxt

在Deep Learning中,往往loss function是非凸的,没有解析解,我们需要通过优化方法来求解。solver的主要作用就是交替调用前向(forward)算法和后向(backward)算法来更新参数,从而最小化loss,实际上就是一种迭代的优化算法。

你可能感兴趣的:(caffe之cifar10_quick_solver.prototxt详解)