OpenNN
2.2
Open Neural Networks Library
|
#include <outputs.h>
Classes | |
struct | Item |
Public Member Functions | |
Outputs (void) | |
Outputs (const size_t &) | |
Outputs (const tinyxml2::XMLDocument &) | |
Outputs (const Outputs &) | |
virtual | ~Outputs (void) |
Outputs & | operator= (const Outputs &) |
bool | operator== (const Outputs &) const |
bool | is_empty (void) const |
size_t | get_outputs_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< Item > &) |
void | set (const Outputs &) |
void | set_outputs_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_output (void) |
void | prune_output (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 |
Vector< std::string > | units |
Vector< std::string > | descriptions |
bool | display |
This class is used to store some information about the output variables of a neural network. That information basically consists on the names, units and descriptions of the output variables.
|
explicit |
Default constructor. It creates a outputs information object with zero outputs.
Definition at line 26 of file outputs.cpp.
|
explicit |
Outputs number constructor. It creates a outputs object with a given number of outputs. This constructor initializes the members of the object to their default values.
new_outputs_number | Number of outputs. |
Definition at line 39 of file outputs.cpp.
|
explicit |
XML constructor. It creates an outputs object and loads its members from a XML document.
outputs_document | TinyXML document with the member data. |
Definition at line 51 of file outputs.cpp.
OpenNN::Outputs::Outputs | ( | const Outputs & | other_outputs | ) |
Copy constructor. It creates a copy of an existing outputs object.
other_outputs | Outputs object to be copied. |
Definition at line 63 of file outputs.cpp.
Vector< std::string > OpenNN::Outputs::arrange_descriptions | ( | void | ) | const |
Returns the descriptions of the output variables as strings. Such descriptions are only used to give the user basic information about the problem at hand.
Definition at line 198 of file outputs.cpp.
Matrix< std::string > OpenNN::Outputs::arrange_information | ( | void | ) | const |
Returns all the available information about the outputs as a single matrix of strings. The number of rows is the number of outputs. The number of columns is three. Each row contains the information of a single output (name, units and description).
Definition at line 284 of file outputs.cpp.
Vector< std::string > OpenNN::Outputs::arrange_names | ( | void | ) | const |
Returns the names of the output variables. Such names are only used to give the user basic information about the problem at hand.
Definition at line 147 of file outputs.cpp.
Vector< std::string > OpenNN::Outputs::arrange_units | ( | void | ) | const |
Returns the units of the output variables as strings. Such units are only used to give the user basic information about the problem at hand.
Definition at line 240 of file outputs.cpp.
|
virtual |
Deserializes a TinyXML document into this outputs object.
document | XML document containing the member data. |
Definition at line 839 of file outputs.cpp.
const std::string & OpenNN::Outputs::get_description | ( | const size_t & | index | ) | const |
Returns the description of a single output variable as a string. Such a description is only used to give the user basic information about the problem at hand.
index | Index of output variable. |
Definition at line 210 of file outputs.cpp.
const bool & OpenNN::Outputs::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 306 of file outputs.cpp.
const std::string & OpenNN::Outputs::get_name | ( | const size_t & | index | ) | const |
Returns the name of a single output variable. Such a name is only used to give the user basic information about the problem at hand.
index | Index of output variable. |
Definition at line 168 of file outputs.cpp.
const std::string & OpenNN::Outputs::get_unit | ( | const size_t & | index | ) | const |
Returns the units of a single output variable as a string. Such units are only used to give the user basic information about the problem at hand.
index | Index of output variable. |
Definition at line 252 of file outputs.cpp.
Assignment operator. It assigns to this object the members of an existing outputs object.
other_outputs | Outputs object to be assigned. |
Definition at line 84 of file outputs.cpp.
bool OpenNN::Outputs::operator== | ( | const Outputs & | other_outputs | ) | 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_outputs Outputs object to be compared with.
Definition at line 109 of file outputs.cpp.
void OpenNN::Outputs::prune_output | ( | const size_t & | index | ) |
Removes a given item from the outputs.
index | Index of item to be pruned. |
Definition at line 674 of file outputs.cpp.
void OpenNN::Outputs::set | ( | void | ) |
Sets zero outputs. It also sets the rest of members to their default values.
Definition at line 317 of file outputs.cpp.
void OpenNN::Outputs::set | ( | const size_t & | new_outputs_number | ) |
Sets a new number of outputs. It also sets the rest of members to their default values.
new_outputs_number | Number of outputs. |
Definition at line 331 of file outputs.cpp.
Sets all the outputs from a single vector of items.
new_items | Output items. |
Definition at line 357 of file outputs.cpp.
void OpenNN::Outputs::set | ( | const Outputs & | other_outputs | ) |
Sets the members of this outputs object with those from another object of the same class.
other_outputs | Outputs object to be copied. |
Definition at line 344 of file outputs.cpp.
void OpenNN::Outputs::set_description | ( | const size_t & | index, |
const std::string & | new_description | ||
) |
Sets a new description for a single output variable. Such value is only used to give the user basic information on the problem at hand.
index | Index of output variable. |
new_description | New description for the output variable with index i. |
Definition at line 586 of file outputs.cpp.
void OpenNN::Outputs::set_descriptions | ( | const Vector< std::string > & | new_descriptions | ) |
Sets new descriptions for all the output variables. Such values are only used to give the user basic information on the problem at hand.
new_descriptions | New description for the output variables. |
Definition at line 550 of file outputs.cpp.
void OpenNN::Outputs::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 651 of file outputs.cpp.
void OpenNN::Outputs::set_information | ( | const Matrix< std::string > & | new_information | ) |
Sets all the possible information about the output variables. The format is a vector of vectors of size three:
new_information | Output variables information. |
Definition at line 629 of file outputs.cpp.
void OpenNN::Outputs::set_name | ( | const size_t & | index, |
const std::string & | new_name | ||
) |
Sets the name of a single output variable. Such value is only used to give the user basic information on the problem at hand.
index | Index of output variable. |
new_name | New name for the output variable with index i. |
Definition at line 443 of file outputs.cpp.
void OpenNN::Outputs::set_names | ( | const Vector< std::string > & | new_names | ) |
Sets the names of the output variables. Such values are only used to give the user basic information on the problem at hand.
new_names | New names for the output variables. |
Definition at line 404 of file outputs.cpp.
void OpenNN::Outputs::set_outputs_number | ( | const size_t & | new_outputs_number | ) |
Sets a new number of outputs.
new_outputs_number | Number of outputs. |
Definition at line 368 of file outputs.cpp.
void OpenNN::Outputs::set_unit | ( | const size_t & | index, |
const std::string & | new_units | ||
) |
Sets new units for a single output variable. Such value is only used to give the user basic information on the problem at hand.
index | Index of output variable. |
new_units | New units for that output variable. |
Definition at line 512 of file outputs.cpp.
void OpenNN::Outputs::set_units | ( | const Vector< std::string > & | new_units | ) |
Sets new units for all the output variables. Such values are only used to give the user basic information on the problem at hand.
new_units | New units for the output variables. |
Definition at line 476 of file outputs.cpp.
|
virtual |
Serializes the outputs information 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 760 of file outputs.cpp.
Vector< std::string > OpenNN::Outputs::write_default_names | ( | void | ) | const |
Returns the default names for the output variables:
Definition at line 708 of file outputs.cpp.