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

Method write_proto

src/models/model.cpp:2046–2084  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2044}
2045
2046void model::write_proto(lbann_data::Model& proto)
2047{
2048 if (!get_comm()->am_trainer_master())
2049 return;
2050
2051 proto.Clear();
2052 proto.set_name(this->get_name());
2053 this->get_objective_function()->write_proto(
2054 *proto.mutable_objective_function());
2055 for (auto const* metric : this->get_metrics()) {
2056 auto* met = proto.add_metric()->mutable_layer_metric();
2057 met->set_name(metric->name());
2058 met->set_unit(metric->get_unit());
2059 }
2060 for (auto* layer : this->get_layers()) {
2061 layer->write_proto(*proto.add_layer());
2062 }
2063 for (auto* weights : this->get_weights()) {
2064 weights->write_proto(*proto.add_weights());
2065 }
2066 for (auto* callback : this->get_callbacks()) {
2067 callback->write_proto(*proto.add_callback());
2068 }
2069 for (auto const& l : m_layers) {
2070 auto* l_msg = proto.add_layer();
2071 l->write_proto(*l_msg);
2072 }
2073
2074 // Unused proto fields
2075 // proto.set_data_layout(string_value);
2076 // proto.set_num_epochs(int64_value);
2077 // proto.set_num_batches(int64_value);
2078 // proto.set_evaluation_frequency(int64_value);
2079 // proto.set_subgraph_communication(SubGraphCommunication_value);
2080 // proto.enable_subgraph_topology(bool_value);
2081 // proto.subgraph_parent_grid_resources(int64_value);
2082 // proto.set_disable_cuda(bool_value);
2083 // proto.set_summarizer(Summarizer_value);
2084}
2085
2086void model::save_model()
2087{

Callers

nothing calls this directly

Calls 14

get_nameMethod · 0.95
get_metricsMethod · 0.95
get_layersMethod · 0.95
get_weightsMethod · 0.95
get_callbacksMethod · 0.95
am_trainer_masterMethod · 0.80
add_metricMethod · 0.80
add_layerMethod · 0.80
set_nameMethod · 0.45
nameMethod · 0.45
get_unitMethod · 0.45

Tested by

no test coverage detected