OpenNN
2.2
Open Neural Networks Library
|
#include <inputs.h>
Classes | |
struct | Item |
Public Member Functions | |
Inputs (void) | |
Inputs (const size_t &) | |
Inputs (const tinyxml2::XMLDocument &) | |
Inputs (const Inputs &) | |
virtual | ~Inputs (void) |
Inputs & | operator= (const Inputs &) |
bool | operator== (const Inputs &) const |
bool | is_empty (void) const |
size_t | get_inputs_number (void) const |
Vector< std::string > | arrange_names (void) const |
const std::string & | get_name (const size_t &) const |
Vector< std::string > | arrange_units (void) const |
const std::string & | get_unit (const size_t &) const |
Vector< std::string > | arrange_descriptions (void) const |
const std::string & | get_description (const size_t &) const |
Matrix< std::string > | arrange_information (void) const |
const bool & | get_display (void) const |
void | set (void) |
void | set (const size_t &) |
void | set (const Vector< Vector< std::string > > &) |
void | set (const Inputs &) |
void | set_inputs_number (const size_t &) |
virtual void | set_default (void) |
void | set_names (const Vector< std::string > &) |
void | set_name (const size_t &, const std::string &) |
void | set_units (const Vector< std::string > &) |
void | set_unit (const size_t &, const std::string &) |
void | set_descriptions (const Vector< std::string > &) |
void | set_description (const size_t &, const std::string &) |
void | set_information (const Matrix< std::string > &) |
void | set_display (const bool &) |
void | grow_input (void) |
void | prune_input (const size_t &) |
Vector< std::string > | write_default_names (void) const |
std::string | to_string (void) const |
virtual tinyxml2::XMLDocument * | to_XML (void) const |
virtual void | from_XML (const tinyxml2::XMLDocument &) |
Protected Attributes | |
Vector< Item > | items |
bool | display |
This class is used to store some information about the input variables of a neural network. That information basically consists on the names, units and descriptions of the input variables.
|
explicit |
Default constructor. It creates an inputs object with zero inputs.
Definition at line 26 of file inputs.cpp.
|
explicit |
Inputs number constructor. It creates an inputs object with given numbers of inputs. This constructor initializes the members of the object to their default values.
new_inputs_number | Number of inputs. |
Definition at line 39 of file inputs.cpp.
|
explicit |
XML constructor. It creates an inputs object and loads its members from a XML document.
document | TinyXML document with the member data. |
Definition at line 51 of file inputs.cpp.
OpenNN::Inputs::Inputs | ( | const Inputs & | other_inputs | ) |
Copy constructor. It creates a copy of an existing inputs object.
other_inputs | Inputs object to be copied. |
Definition at line 63 of file inputs.cpp.
Vector< std::string > OpenNN::Inputs::arrange_descriptions | ( | void | ) | const |
Returns the description of the input variables as strings. Such descriptions are only used to give the user basic information about the problem at hand.
Definition at line 249 of file inputs.cpp.
Matrix< std::string > OpenNN::Inputs::arrange_information | ( | void | ) | const |
Returns the information of all input variables from a single matrix of strings. The information contains names, inputs and descriptions. The number of rows in the matris is the number of inputs, and the number of columns is three. Each row contains the information of a single input variable.
Definition at line 302 of file inputs.cpp.
Vector< std::string > OpenNN::Inputs::arrange_names | ( | void | ) | const |
Returns the names of the input variables. Such names are only used to give the user basic information about the problem at hand.
Definition at line 147 of file inputs.cpp.
Vector< std::string > OpenNN::Inputs::arrange_units | ( | void | ) | const |
Returns the units of the input variables as strings. Such units are only used to give the user basic information about the problem at hand.
Definition at line 198 of file inputs.cpp.
|
virtual |
Deserializes a TinyXML document into this inputs object.
document | XML document containing the member data. |
Definition at line 899 of file inputs.cpp.
const std::string & OpenNN::Inputs::get_description | ( | const size_t & | index | ) | const |
Returns the description of a single input variable as a string. Such a description is only used to give the user basic information about the problem at hand.
index | Index of input variable. |
Definition at line 270 of file inputs.cpp.
const bool & OpenNN::Inputs::get_display | ( | void | ) | const |
Returns true if messages from this class are to be displayed on the screen, or false if messages from this class are not to be displayed on the screen.
Definition at line 324 of file inputs.cpp.
const std::string & OpenNN::Inputs::get_name | ( | const size_t & | i | ) | const |
Returns the name of a single input variable. Such a name is only used to give the user basic information about the problem at hand.
i | Index of input variable. |
Definition at line 168 of file inputs.cpp.
const std::string & OpenNN::Inputs::get_unit | ( | const size_t & | index | ) | const |
Returns the units of a single input variable as a string. Such units are only used to give the user basic information about the problem at hand.
index | Index of input variable. |
Definition at line 219 of file inputs.cpp.
Assignment operator. It assigns to this object the members of an existing inputs object.
other_inputs | Inputs object to be assigned. |
Definition at line 84 of file inputs.cpp.
bool OpenNN::Inputs::operator== | ( | const Inputs & | other_inputs | ) | 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_inputs Inputs object to be compared with.
Definition at line 109 of file inputs.cpp.
void OpenNN::Inputs::prune_input | ( | const size_t & | index | ) |
Removes a given item from the inputs.
index | Index of item to be pruned. |
Definition at line 733 of file inputs.cpp.
void OpenNN::Inputs::set | ( | void | ) |
Sets zero inputs. It also sets the rest of members to their default values.
Definition at line 335 of file inputs.cpp.
void OpenNN::Inputs::set | ( | const size_t & | new_inputs_number | ) |
Sets a new number of inputs. It also sets the rest of members to their default values.
new_inputs_number | Number of inputs. |
Definition at line 349 of file inputs.cpp.
void OpenNN::Inputs::set | ( | const Inputs & | other_inputs | ) |
Sets the members of this inputs object with those from another object of the same class.
other_inputs | Inputs object to be copied. |
Definition at line 362 of file inputs.cpp.
void OpenNN::Inputs::set_description | ( | const size_t & | index, |
const std::string & | new_description | ||
) |
Sets a new description for a single input variable. Such value is only used to give the user basic information on the problem at hand.
index | Index of input variable. |
new_description | New description for the input variable with index i. |
Definition at line 632 of file inputs.cpp.
void OpenNN::Inputs::set_descriptions | ( | const Vector< std::string > & | new_descriptions | ) |
Sets new descriptions for all the input variables. Such values are only used to give the user basic information on the problem at hand.
new_descriptions | New description for the input variables. |
Definition at line 592 of file inputs.cpp.
void OpenNN::Inputs::set_display | ( | const bool & | new_display | ) |
Sets a new display value. If it is set to true messages from this class are to be displayed on the screen; if it is set to false messages from this class are not to be displayed on the screen.
new_display | Display value. |
Definition at line 710 of file inputs.cpp.
void OpenNN::Inputs::set_information | ( | const Matrix< std::string > & | new_information | ) |
Sets all the possible information about the input variables. The format is a vector of vectors of size three:
new_information | Input variables information. |
Definition at line 670 of file inputs.cpp.
void OpenNN::Inputs::set_inputs_number | ( | const size_t & | new_inputs_number | ) |
Sets a new number of inputs.
new_inputs_number | Number of inputs. |
Definition at line 412 of file inputs.cpp.
void OpenNN::Inputs::set_name | ( | const size_t & | i, |
const std::string & | new_name | ||
) |
Sets the name of a single input variable. Such value is only used to give the user basic information on the problem at hand.
i | Index of input variable. |
new_name | New name for the input variable with index i. |
Definition at line 487 of file inputs.cpp.
void OpenNN::Inputs::set_names | ( | const Vector< std::string > & | new_names | ) |
Sets the names for the input variables. Such values are only used to give the user basic information on the problem at hand.
new_names | New names for the input variables. |
Definition at line 448 of file inputs.cpp.
void OpenNN::Inputs::set_unit | ( | const size_t & | index, |
const std::string & | new_unit | ||
) |
Sets new units for a single input variable. Such value is only used to give the user basic information on the problem at hand.
index | Index of input variable. |
new_unit | New units for that input variable. |
Definition at line 559 of file inputs.cpp.
void OpenNN::Inputs::set_units | ( | const Vector< std::string > & | new_units | ) |
Sets new units for all the input variables. Such values are only used to give the user basic information on the problem at hand.
new_units | New units for the input variables. |
Definition at line 520 of file inputs.cpp.
|
virtual |
Serializes the inputs object into a XML document of the TinyXML library. See the OpenNN manual for more information about the format of this document->
Definition at line 819 of file inputs.cpp.
Vector< std::string > OpenNN::Inputs::write_default_names | ( | void | ) | const |
Returns the default names for the input variables:
Definition at line 767 of file inputs.cpp.