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

Method do_batch_begin_cbs

src/execution_algorithms/sgd_training_algorithm.cpp:470–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468}
469
470void SGDTrainingAlgorithm::do_batch_begin_cbs(model& model,
471 execution_mode mode,
472 ScopeTimer timer)
473{
474 SGDExecutionContext& c =
475 static_cast<SGDExecutionContext&>(model.get_execution_context());
476
477 for (const auto& cb : model.get_callbacks()) {
478 switch (mode) {
479 case execution_mode::training:
480 if (c.get_step() % cb->get_batch_interval() == 0) {
481 cb->on_batch_begin(&model);
482 }
483 break;
484 case execution_mode::validation:
485 case execution_mode::tournament:
486 case execution_mode::testing:
487 cb->on_batch_evaluate_begin(&model);
488 break;
489 default:
490 LBANN_ERROR("invalid execution mode");
491 }
492 }
493}
494
495void SGDTrainingAlgorithm::do_batch_end_cbs(model& model,
496 execution_mode mode,

Callers

nothing calls this directly

Calls 5

get_stepMethod · 0.80
get_batch_intervalMethod · 0.80
get_callbacksMethod · 0.45
on_batch_beginMethod · 0.45

Tested by

no test coverage detected