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

Function make_model

src/execution_algorithms/unit_test/inference_algorithm_test.cpp:65–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64template <typename T>
65auto make_model(lbann::lbann_comm& comm, int class_n)
66{
67 lbann_data::LbannPB my_proto;
68 if (!pb::TextFormat::ParseFromString(model_prototext, &my_proto))
69 throw "Parsing protobuf failed.";
70 // Construct a trainer so that the model can register the input layer
71 auto& trainer =
72 lbann::construct_trainer(&comm, my_proto.mutable_trainer(), my_proto);
73 unit_test::utilities::mock_data_reader(trainer, {1, 1, class_n}, class_n);
74 auto my_model = lbann::proto::construct_model(&comm,
75 my_proto.optimizer(),
76 my_proto.trainer(),
77 my_proto.model());
78 my_model->setup(class_n, {&comm.get_trainer_grid()});
79 return my_model;
80}
81
82} // namespace
83

Callers

nothing calls this directly

Calls 7

mock_data_readerFunction · 0.85
optimizerMethod · 0.80
trainerMethod · 0.80
modelMethod · 0.80
construct_trainerFunction · 0.50
construct_modelFunction · 0.50
setupMethod · 0.45

Tested by

no test coverage detected