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

Function make_factory

src/execution_algorithms/sgd_training_algorithm.cpp:536–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534 TermCriteria const&>>;
535
536StoppingCriteriaFactory make_factory()
537{
538 using namespace lbann;
539 using namespace std;
540 StoppingCriteriaFactory factory;
541 factory.register_builder(TermCriteria::kMaxBatches,
542 [](TermCriteria const& msg) {
543 return make_unique<BatchTerminationCriteria>(
544 msg.max_batches());
545 });
546 factory.register_builder(TermCriteria::kMaxEpochs,
547 [](TermCriteria const& msg) {
548 return make_unique<EpochTerminationCriteria>(
549 msg.max_epochs());
550 });
551 factory.register_builder(TermCriteria::kMaxSeconds,
552 [](TermCriteria const& msg) {
553 return make_unique<SecondsTerminationCriteria>(
554 msg.max_seconds());
555 });
556 return factory;
557}
558
559StoppingCriteriaFactory& term_criteria_factory()
560{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected