| 2044 | } |
| 2045 | |
| 2046 | void 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 | |
| 2086 | void model::save_model() |
| 2087 | { |
nothing calls this directly
no test coverage detected