OpenNN
2.2
Open Neural Networks Library
|
#include <plug_in.h>
Public Types | |
enum | InputMethod { IndependentParametersInput } |
Public Member Functions | |
PlugIn (void) | |
PlugIn (const tinyxml2::XMLDocument &) | |
virtual | ~PlugIn (void) |
PlugIn & | operator= (const PlugIn &) |
bool | operator== (const PlugIn &) const |
const InputMethod & | get_input_method (void) const |
std::string | write_input_method (void) const |
const std::string & | get_template_file_name (void) const |
const std::string & | get_input_file_name (void) const |
const std::string & | get_script_file_name (void) const |
const std::string & | get_output_file_name (void) const |
const Vector< std::string > & | get_input_flags (void) const |
const std::string & | get_input_flag (const size_t &) const |
void | set_default (void) |
void | set_input_method (const InputMethod &) |
void | set_input_method (const std::string &) |
void | set_template_file_name (const std::string &) |
void | set_input_file_name (const std::string &) |
void | set_script_file_name (const std::string &) |
void | set_output_file_name (const std::string &) |
void | set_input_flags (const Vector< std::string > &) |
void | write_input_file (const NeuralNetwork &) const |
void | write_input_file_independent_parameters (const NeuralNetwork &) const |
void | run_script (void) const |
Matrix< double > | read_output_file (void) const |
Matrix< double > | read_output_file_header (void) const |
Matrix< double > | calculate_solutions (const NeuralNetwork &) const |
std::string | to_string (void) const |
tinyxml2::XMLDocument * | to_XML (void) const |
void | from_XML (const tinyxml2::XMLDocument &) |
Public Member Functions inherited from OpenNN::MathematicalModel | |
MathematicalModel (void) | |
MathematicalModel (const tinyxml2::XMLDocument &) | |
MathematicalModel (const std::string &) | |
MathematicalModel (const MathematicalModel &) | |
virtual | ~MathematicalModel (void) |
virtual MathematicalModel & | operator= (const MathematicalModel &) |
virtual bool | operator== (const MathematicalModel &) const |
const size_t & | get_independent_variables_number (void) const |
const size_t & | get_dependent_variables_number (void) const |
size_t | count_variables_number (void) const |
const bool & | get_display (void) const |
void | set (const MathematicalModel &) |
void | set_independent_variables_number (const size_t &) |
void | set_dependent_variables_number (const size_t &) |
void | set_display (const bool &) |
virtual Vector< double > | calculate_final_solutions (const NeuralNetwork &) const |
virtual Matrix< double > | calculate_dependent_variables (const NeuralNetwork &, const Matrix< double > &) const |
void | print (void) const |
void | save (const std::string &) const |
void | load (const std::string &) |
virtual void | save_data (const NeuralNetwork &, const std::string &) const |
Private Attributes | |
InputMethod | input_method |
std::string | template_file_name |
std::string | input_file_name |
std::string | script_file_name |
std::string | output_file_name |
Vector< std::string > | input_flags |
size_t | output_rows_number |
size_t | output_columns_number |
Additional Inherited Members | |
Protected Attributes inherited from OpenNN::MathematicalModel | |
size_t | independent_variables_number |
size_t | dependent_variables_number |
bool | display |
This method represents an external mathematical model which communicates with OpenNN by means of input and output files.
|
explicit |
Default constructor. It constructs a default plug-in object, with zero independent and dependent variables.
Definition at line 26 of file plug_in.cpp.
|
explicit |
XML constructor. It creates a plug-in and loads its members from a TinyXML document.
plug_in_document | XML document containing the plug-in members. |
Definition at line 38 of file plug_in.cpp.
|
virtual |
Destructor. It does not delete any object.
Definition at line 49 of file plug_in.cpp.
|
virtual |
Returns the solutions to the mathematical model. which are given by the independent and the dependent variables. The process is as follows:
Reimplemented from OpenNN::MathematicalModel.
Definition at line 551 of file plug_in.cpp.
|
virtual |
Deserializes a TinyXML document into this plug-in object.
document | XML document containing the member data. |
Reimplemented from OpenNN::MathematicalModel.
Definition at line 741 of file plug_in.cpp.
const std::string & OpenNN::PlugIn::get_input_flag | ( | const size_t & | i | ) | const |
Returns a single input file flag.
i | Index of flag. |
Definition at line 210 of file plug_in.cpp.
Assignment operator. It assigns to this object the members of an existing plug-in object.
other_plug_in | Plug-in object to be assigned. |
Definition at line 62 of file plug_in.cpp.
bool OpenNN::PlugIn::operator== | ( | const PlugIn & | other_plug_in | ) | const |
Equal to operator. It compares this object with another object of the same class. It returns true if the members of the two objects have the same values, and false otherwise. @ param other_plug_in Plug-in to be compared with.
Definition at line 94 of file plug_in.cpp.
Matrix< double > OpenNN::PlugIn::read_output_file | ( | void | ) | const |
This method reads the output file from the mathematical model. Here the output file only contains a data matrix.
Definition at line 497 of file plug_in.cpp.
Matrix< double > OpenNN::PlugIn::read_output_file_header | ( | void | ) | const |
This method reads the output file from the mathematical model. Here the output file contains a header file and a data matrix.
Definition at line 510 of file plug_in.cpp.
|
virtual |
Sets the following default values in this object:
Reimplemented from OpenNN::MathematicalModel.
Definition at line 227 of file plug_in.cpp.
void OpenNN::PlugIn::set_input_file_name | ( | const std::string & | new_input_file_name | ) |
Sets the name of the input file.
new_input_file_name | Name of input file. |
Definition at line 293 of file plug_in.cpp.
void OpenNN::PlugIn::set_input_flags | ( | const Vector< std::string > & | new_input_flags | ) |
Sets the flags in the input file.
new_input_flags | Flags strings. |
Definition at line 326 of file plug_in.cpp.
void OpenNN::PlugIn::set_input_method | ( | const InputMethod & | new_input_method | ) |
Sets the method for writting the input file.
new_input_method | Method for inputing the input file. |
Definition at line 247 of file plug_in.cpp.
void OpenNN::PlugIn::set_input_method | ( | const std::string & | new_input_method | ) |
Sets the method for writting the input file from a string.
new_input_method | Method for inputing the input file. |
Definition at line 258 of file plug_in.cpp.
void OpenNN::PlugIn::set_output_file_name | ( | const std::string & | new_output_file_name | ) |
Sets the name of the output file.
new_output_file_name | Name of output file. |
Definition at line 315 of file plug_in.cpp.
void OpenNN::PlugIn::set_script_file_name | ( | const std::string & | new_script_file_name | ) |
Sets the name of the script file.
new_script_file_name | Name of script file. |
Definition at line 304 of file plug_in.cpp.
void OpenNN::PlugIn::set_template_file_name | ( | const std::string & | new_template_file_name | ) |
Sets the name of the template file.
new_template_file_name | Name of template file. |
Definition at line 282 of file plug_in.cpp.
|
virtual |
Serializes the plug-in object into a XML document of the TinyXML library. See the OpenNN manual for more information about the format of this document.
Reimplemented from OpenNN::MathematicalModel.
Definition at line 591 of file plug_in.cpp.
void OpenNN::PlugIn::write_input_file | ( | const NeuralNetwork & | neural_network | ) | const |
Thise method writes the input file with values obtained from the neural network.
neural_network | Neural network. |
Definition at line 337 of file plug_in.cpp.
void OpenNN::PlugIn::write_input_file_independent_parameters | ( | const NeuralNetwork & | neural_network | ) | const |
Definition at line 366 of file plug_in.cpp.