|
DiSMEC++
|
Functions | |
| void | save_weights_dispatch (std::ostream &target, const Model &model, SaveOption &options) |
This function calls on of the save functions, depending on the format specified on options More... | |
| void | read_weights_dispatch (std::istream &source, WeightFormat format, Model &model) |
| This function calls the reads function that corresponds to the given weight format. More... | |
| std::shared_ptr< Model > | make_model (long num_features, ::model::PartialModelSpec spec, bool sparse) |
| bool | use_sparse_weights (PartialModelLoader::ESparseMode mode, WeightFormat format) |
Variables | |
| const std::array< const char *, 4 > | weight_format_names |
Translation from io::model::WeightFormat to std::string. More... | |
| const std::array< bool, 4 > | weight_format_sparsity |
| Lookup which mode has sparse weights. More... | |
| std::shared_ptr<Model> anonymous_namespace{model-io.cpp}::make_model | ( | long | num_features, |
| ::model::PartialModelSpec | spec, | ||
| bool | sparse | ||
| ) |
Definition at line 400 of file model-io.cpp.
Referenced by dismec::io::model::PartialModelLoader::load_model().
| void anonymous_namespace{model-io.cpp}::read_weights_dispatch | ( | std::istream & | source, |
| WeightFormat | format, | ||
| Model & | model | ||
| ) |
This function calls the reads function that corresponds to the given weight format.
| source | Stream from which the data is read. |
| format | Data format used to interpret source. |
| model | Model in which the weights will be stored. Must already have allocated enough space to store the weights. |
Definition at line 67 of file model-io.cpp.
References dismec::io::model::DENSE_NPY, dismec::io::model::DENSE_TXT, dismec::io::model::load_dense_weights_npy(), dismec::io::model::load_dense_weights_txt(), dismec::io::model::load_sparse_weights_txt(), and dismec::io::model::SPARSE_TXT.
Referenced by dismec::io::model::PartialModelLoader::load_model().
| void anonymous_namespace{model-io.cpp}::save_weights_dispatch | ( | std::ostream & | target, |
| const Model & | model, | ||
| SaveOption & | options | ||
| ) |
This function calls on of the save functions, depending on the format specified on options
| target | Stream where to save the weights. |
| model | The model whose weights will be saved. |
| options | Saving options. The format of the save file depends on this. |
Definition at line 43 of file model-io.cpp.
References dismec::io::model::SaveOption::Culling, dismec::io::model::DENSE_NPY, dismec::io::model::DENSE_TXT, dismec::io::model::SaveOption::Format, dismec::io::model::NULL_FORMAT, dismec::io::model::SaveOption::Precision, dismec::io::model::save_as_sparse_weights_txt(), dismec::io::model::save_dense_weights_npy(), dismec::io::model::save_dense_weights_txt(), and dismec::io::model::SPARSE_TXT.
| bool anonymous_namespace{model-io.cpp}::use_sparse_weights | ( | PartialModelLoader::ESparseMode | mode, |
| WeightFormat | format | ||
| ) |
Definition at line 408 of file model-io.cpp.
References dismec::io::model::PartialModelLoader::DEFAULT, dismec::io::model::PartialModelLoader::FORCE_DENSE, dismec::io::model::PartialModelLoader::FORCE_SPARSE, and weight_format_sparsity.
Referenced by dismec::io::model::PartialModelLoader::load_model().
| const std::array<const char*, 4> anonymous_namespace{model-io.cpp}::weight_format_names |
Translation from io::model::WeightFormat to std::string.
Definition at line 28 of file model-io.cpp.
Referenced by dismec::io::model::parse_weights_format(), and dismec::io::model::to_string().
| const std::array<bool, 4> anonymous_namespace{model-io.cpp}::weight_format_sparsity |
Lookup which mode has sparse weights.
Definition at line 33 of file model-io.cpp.
Referenced by use_sparse_weights().