proto_file.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Sensor-Specific-Hyperspectral-Image-Feature-Learning 作者: MeiShaohui 项目源码 文件源码
def train_solver(conf):
    s = caffe_pb2.SolverParameter()

    # Set a seed for reproducible experiments:
    # this controls for randomization in training.
    #s.random_seed = 0xCAFFE

    # Specify locations of the train and (maybe) test networks.
    s.train_net = conf.train_net_file
    s.test_net.append(conf.test_net_file)
    s.test_interval = 10000  # Test after every 500 training iterations.
    s.test_iter.append(1)  # Test on 100 batches each time we test.
    s.max_iter = conf.max_iter  # no. of times to update the net (training iterations)
    # s.max_iter = 50000  # no. of times to update the net (training iterations)
    s.type = "AdaGrad"
    s.gamma = 0.1
    s.base_lr = 0.01
    s.weight_decay = 5e-4
    s.lr_policy = 'multistep'
    s.display = 10000
    s.snapshot = 10000
    s.snapshot_prefix = conf.snapshot_prefix
    #s.stepvalue.append(1000000)
    #s.stepvalue.append(300000)
    s.solver_mode = caffe_pb2.SolverParameter.GPU
    s.device_id = 1 # will use the second GPU card
    s.snapshot_format = 0 # 0 is HDF5, 1 is binary
    return s
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号