NeuralNet 1.0
Loading...
Searching...
No Matches
NeuralNet::Model Class Referenceabstract
Inheritance diagram for NeuralNet::Model:
NeuralNet::Network

Public Member Functions

virtual void to_file (const std::string &filename)=0
 
virtual void from_file (const std::string &filename)=0
 

Static Public Member Functions

template<typename T , typename = typename std::enable_if< std::is_base_of<Model, T>::value>::type>
static void save_to_file (const std::string &filename, T model)
 This method will save (by serializing) the model passed as argument to a .bin file.
 
template<typename T , typename = typename std::enable_if< std::is_base_of<Model, T>::value>::type>
static void load_from_file (const std::string &filename, T &model)
 This static method loads a Model from a file and assigns it to the supposedly "empty" model passed as argument.
 

Protected Member Functions

void registerSignals () const
 

Protected Attributes

int cEpoch = 0
 
double loss = 0
 
double accuracy = 0
 
double testLoss = 0
 
double testAccuracy = 0
 

Friends

class cereal::access
 
class Callback
 

Member Function Documentation

◆ from_file()

virtual void NeuralNet::Model::from_file ( const std::string & filename)
pure virtual

Implemented in NeuralNet::Network.

◆ load_from_file()

template<typename T , typename = typename std::enable_if< std::is_base_of<Model, T>::value>::type>
static void NeuralNet::Model::load_from_file ( const std::string & filename,
T & model )
inlinestatic

This static method loads a Model from a file and assigns it to the supposedly "empty" model passed as argument.

Parameters
filenameThe name of the binary file from which to retrieve the model
modelAn "empty" model which will be filled with the loaded model's parameters

This function will assign the parameters of the saved model in the binary file to the model passed as a parameter

◆ save_to_file()

template<typename T , typename = typename std::enable_if< std::is_base_of<Model, T>::value>::type>
static void NeuralNet::Model::save_to_file ( const std::string & filename,
T model )
inlinestatic

This method will save (by serializing) the model passed as argument to a .bin file.

Parameters
filenameThe binary file in which the serialized model will be saved
modelThe model that will be serialized and saved

◆ to_file()

virtual void NeuralNet::Model::to_file ( const std::string & filename)
pure virtual

Implemented in NeuralNet::Network.


The documentation for this class was generated from the following file: