DiSMEC++
weights.h
Go to the documentation of this file.
1 // Copyright (c) 2021, Aalto University, developed by Erik Schultheis
2 // All rights reserved.
3 //
4 // SPDX-License-Identifier: MIT
5 
6 #ifndef DISMEC_WEIGHTS_H
7 #define DISMEC_WEIGHTS_H
8 
9 #include <iosfwd>
10 #include "fwd.h"
11 
12 namespace dismec::io::model
13 {
15 
25  void save_dense_weights_txt(std::ostream& target, const Model& model);
26 
35  void load_dense_weights_txt(std::istream& source, Model& target);
36 
48  void save_dense_weights_npy(std::streambuf& target, const Model& model);
49 
58  void load_dense_weights_npy(std::streambuf& target, Model& model);
59 
69  void save_as_sparse_weights_txt(std::ostream& target, const Model& model, double threshold);
70 
79  void load_sparse_weights_txt(std::istream& source, Model& target);
80 }
81 
82 
83 #endif //DISMEC_WEIGHTS_H
A model combines a set of weight with some meta-information about these weights.
Definition: model.h:63
Forward-declares types.
namespace for all model-related io functions.
Definition: model-io.h:92
void load_sparse_weights_txt(std::istream &source, Model &target)
Loads sparse weights from plain-text format.
Definition: weights.cpp:140
void save_dense_weights_npy(std::streambuf &target, const Model &model)
Saves the dense weights in a npy file.
Definition: weights.cpp:73
void save_as_sparse_weights_txt(std::ostream &target, const Model &model, double threshold)
Saves the weights in sparse plain-text format, culling small weights.
Definition: weights.cpp:111
void load_dense_weights_txt(std::istream &source, Model &target)
Loads weights saved by io::model::save_dense_weights_txt.
Definition: weights.cpp:61
void save_dense_weights_txt(std::ostream &target, const Model &model)
Saves the dense weights in a plain-text format.
Definition: weights.cpp:51
void load_dense_weights_npy(std::streambuf &target, Model &model)
Loads dense weights from a npy file.
Definition: weights.cpp:82