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

Method evaluate_mini_batch

src/execution_algorithms/sgd_training_algorithm.cpp:359–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359bool SGDTrainingAlgorithm::evaluate_mini_batch(SGDExecutionContext& c,
360 model& model,
361 data_coordinator& dc,
362 execution_mode mode,
363 ScopeTimer timer)
364{
365 model.reset_mode(c, mode);
366 dc.reset_mode(c);
367 do_batch_begin_cbs(model, mode, ScopeTimer{timer, "batch_begin callbacks"});
368 if (get_trainer().background_io_activity_allowed()) {
369 dc.fetch_data_asynchronous(mode);
370 }
371 else {
372 dc.fetch_active_batch_synchronous(mode);
373 }
374 El::Int current_mini_batch_size = dc.get_current_mini_batch_size(mode);
375 model.set_current_mini_batch_size(current_mini_batch_size);
376 model.forward_prop(mode);
377 bool const finished = dc.ready_for_next_fetch(mode);
378
379 model.get_objective_function()->start_evaluation(mode,
380 current_mini_batch_size);
381 model.get_objective_function()->finish_evaluation(mode,
382 current_mini_batch_size);
383 model.evaluate_metrics(mode, current_mini_batch_size);
384 model.update_layers();
385 c.inc_step();
386 do_batch_end_cbs(model, mode, ScopeTimer{timer, "batch_end callbacks"});
387 return finished;
388}
389
390std::unique_ptr<SGDExecutionContext>
391SGDTrainingAlgorithm::get_new_execution_context() const

Callers

nothing calls this directly

Calls 14

ready_for_next_fetchMethod · 0.80
evaluate_metricsMethod · 0.80
update_layersMethod · 0.80
inc_stepMethod · 0.80
reset_modeMethod · 0.45
forward_propMethod · 0.45

Tested by

no test coverage detected