SuperNN
1.0.0
|
Auxiliary class to ease the usage of an already trained neural network. More...
Public Member Functions | |
Runner (const std::string &net_path, const std::string &info_path) | |
Constructor. More... | |
Runner () | |
virtual | ~Runner () |
double & | inp (unsigned idx) |
Accessor to get/set an input value. More... | |
void | load_info_file (const std::string &info_path) |
Loads the bounds info file. More... | |
double | out (unsigned idx) |
Accessor to get an output value. More... | |
void | run () |
Runs the network with the current input setted by inp(). More... | |
void | set_bounds (Bounds &from, Bounds &to) |
Sets the bounds from already built Bound objects. More... | |
Public Attributes | |
Data | inp_data |
Network | net |
Data | out_data |
Auxiliary class to ease the usage of an already trained neural network.
It handles the input, scaling, running and descaling operations.
Definition at line 36 of file runner.hpp.
SuperNN::Runner::Runner | ( | const std::string & | net_path, |
const std::string & | info_path | ||
) |
Constructor.
net_path | Path to the neural network file |
info_path | Path to the scaling info file |
ErrorType | if the input files couldn't be opened |
Definition at line 30 of file runner.cpp.
SuperNN::Runner::Runner | ( | ) |
Definition at line 26 of file runner.cpp.
|
virtual |
Definition at line 36 of file runner.cpp.
double & SuperNN::Runner::inp | ( | unsigned | idx | ) |
Accessor to get/set an input value.
idx | Neuron index |
Definition at line 74 of file runner.cpp.
void SuperNN::Runner::load_info_file | ( | const std::string & | info_path | ) |
Loads the bounds info file.
Can only be called when the 'net' member variable is set.
info_path | Path to the bounds info file |
ErrorType | if the input files couldn't be opened |
Definition at line 67 of file runner.cpp.
double SuperNN::Runner::out | ( | unsigned | idx | ) |
Accessor to get an output value.
idx | Neuron index |
Definition at line 79 of file runner.cpp.
void SuperNN::Runner::run | ( | ) |
Runs the network with the current input setted by inp().
Handles the input scaling and output descaling.
Definition at line 84 of file runner.cpp.
Sets the bounds from already built Bound objects.
Can only be called when the 'net' member variable is set.
from | From bounds |
to | To bounds |
Definition at line 40 of file runner.cpp.
Data SuperNN::Runner::inp_data |
Definition at line 90 of file runner.hpp.
Network SuperNN::Runner::net |
Definition at line 89 of file runner.hpp.
Data SuperNN::Runner::out_data |
Definition at line 90 of file runner.hpp.