Skip to content

Commit

Permalink
dd api for caffe warmup
Browse files Browse the repository at this point in the history
  • Loading branch information
fantes committed Aug 22, 2019
1 parent 00f98a4 commit ce75fae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/backends/caffe/caffelib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,10 @@ namespace dd
solver_param.set_lr_policy(ad_solver.get("lr_policy").get<std::string>());
if (ad_solver.has("base_lr"))
solver_param.set_base_lr(ad_solver.get("base_lr").get<double>());
if (ad_solver.has("warmup_lr"))
solver_param.set_warmup_start_lr(ad_solver.get("warmup_lr").get<double>());
if (ad_solver.has("warmup_iter"))
solver_param.set_warmup_iter(ad_solver.get("warmup_iter").get<int>());
if (ad_solver.has("gamma"))
solver_param.set_gamma(ad_solver.get("gamma").get<double>());
if (ad_solver.has("stepsize"))
Expand Down Expand Up @@ -1409,6 +1413,8 @@ namespace dd
{
caffe::SGDSolver<float> *sgd_solver = static_cast<caffe::SGDSolver<float>*>(solver.get());
this->_logger->info("Iteration {}, lr = {}, smoothed_loss={}",solver->iter_,sgd_solver->GetLearningRate(),this->get_meas("train_loss"));
if (sgd_solver->param_.warmup_iter() > 0)
this->_logger->info("[doing warmup (start_lr = {}, iter = {})]",solver->param_.warmup_start_lr(),solver->param_.warmup_iter());
}
try
{
Expand Down

0 comments on commit ce75fae

Please sign in to comment.