MCPcopy Create free account
hub / github.com/LBANN/lbann / apply

Method apply

src/execution_algorithms/sgd_training_algorithm.cpp:70–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68////////////////////////////////////////////////////////////
69
70void 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
99void SGDTrainingAlgorithm::train(SGDExecutionContext& c,
100 model& model,

Callers

nothing calls this directly

Calls 8

build_stringFunction · 0.85
get_trainer_rankMethod · 0.80
am_trainer_masterMethod · 0.80
printMethod · 0.80
evaluateFunction · 0.50
to_stringFunction · 0.50
get_nameMethod · 0.45
get_commMethod · 0.45

Tested by

no test coverage detected