| 68 | //////////////////////////////////////////////////////////// |
| 69 | |
| 70 | void SGDTrainingAlgorithm::apply(ExecutionContext& context, |
| 71 | model& model, |
| 72 | data_coordinator& dc, |
| 73 | execution_mode mode) |
| 74 | { |
| 75 | m_timers = TimerMap{build_string("SGD::", |
| 76 | this->get_name(), |
| 77 | " (trainer:", |
| 78 | get_trainer().get_comm()->get_trainer_rank(), |
| 79 | ")")}; |
| 80 | SGDExecutionContext& sgd_context = |
| 81 | dynamic_cast<SGDExecutionContext&>(context); |
| 82 | const SGDTerminationCriteria& sgd_term = *m_stopping_criteria; |
| 83 | switch (mode) { |
| 84 | case execution_mode::training: |
| 85 | train(sgd_context, model, dc, sgd_term); |
| 86 | break; |
| 87 | case execution_mode::validation: |
| 88 | case execution_mode::testing: |
| 89 | case execution_mode::prediction: |
| 90 | evaluate(sgd_context, model, dc, mode, sgd_term); |
| 91 | break; |
| 92 | default: |
| 93 | LBANN_ERROR("Illegal mode: ", to_string(mode)); |
| 94 | } |
| 95 | if (!m_suppress_timer && model.get_comm()->am_trainer_master()) |
| 96 | m_timers.print(std::cout); |
| 97 | } |
| 98 | |
| 99 | void SGDTrainingAlgorithm::train(SGDExecutionContext& c, |
| 100 | model& model, |
nothing calls this directly
no test coverage detected