| 468 | } |
| 469 | |
| 470 | void 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 | |
| 495 | void SGDTrainingAlgorithm::do_batch_end_cbs(model& model, |
| 496 | execution_mode mode, |
nothing calls this directly
no test coverage detected