caffe中solver配置文件的解读

来源:互联网 发布:c语言返回值什么意思 编辑:程序博客网 时间:2024/05/20 02:21

刚刚步入caffe,对solver进行解读,用caffe中例子cifar-10的cifar10_quick_solver.prototxt文件进行演示:


# reduce the learning rate after 8 epochs (4000 iters) by a factor of 10



# The train/test net protocol buffer definition,网络架构文件,包含卷积网络中的层次定义,例如卷积层,relu层,softmax层等
net: "examples/cifar10/cifar10_quick_train_test.prototxt"
# 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图片,并且分成100批(test_iter:100)投入,

#因此(full 10,000 testing images)= (test_iter: 100)* (test的batch_size: 100)

test_iter: 100
# Carry out testing every 500 training iterations.每隔500次训练进行一次测试
test_interval: 500
# The base learning rate, momentum and the weight decay of the network.学习率、动量、权重衰减
base_lr: 0.001  
momentum: 0.9
weight_decay: 0.004
# The learning rate policy
lr_policy: "fixed"
# Display every 100 iterations,每隔100次训练,输出一次迭代结果
display: 100
# The maximum number of iterations,最大训练次数
max_iter: 4000
# snapshot intermediate results,每隔4000次保存一次当前训练的结果,并生成为模型文件
snapshot: 4000
snapshot_format: HDF5
snapshot_prefix: "examples/cifar10/cifar10_quick"
# solver mode: CPU or GPU,选择CPU或GPU训练
solver_mode: GPU
0 0