OpenNN  2.2
Open Neural Networks Library
Classes | Public Member Functions | Protected Attributes | List of all members
OpenNN::Outputs Class Reference

#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)
 
Outputsoperator= (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< Itemitems
 
Vector< std::string > units
 
Vector< std::string > descriptions
 
bool display
 

Detailed Description

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.

Definition at line 41 of file outputs.h.

Constructor & Destructor Documentation

OpenNN::Outputs::Outputs ( void  )
explicit

Default constructor. It creates a outputs information object with zero outputs.

Definition at line 26 of file outputs.cpp.

OpenNN::Outputs::Outputs ( const size_t &  new_outputs_number)
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.

Parameters
new_outputs_numberNumber of outputs.

Definition at line 39 of file outputs.cpp.

OpenNN::Outputs::Outputs ( const tinyxml2::XMLDocument &  outputs_document)
explicit

XML constructor. It creates an outputs object and loads its members from a XML document.

Parameters
outputs_documentTinyXML 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.

Parameters
other_outputsOutputs object to be copied.

Definition at line 63 of file outputs.cpp.

Member Function Documentation

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.

void OpenNN::Outputs::from_XML ( const tinyxml2::XMLDocument &  document)
virtual

Deserializes a TinyXML document into this outputs object.

Parameters
documentXML 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.

Parameters
indexIndex 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.

Parameters
indexIndex 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.

Parameters
indexIndex of output variable.

Definition at line 252 of file outputs.cpp.

Outputs & OpenNN::Outputs::operator= ( const Outputs other_outputs)

Assignment operator. It assigns to this object the members of an existing outputs object.

Parameters
other_outputsOutputs 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.

Parameters
indexIndex 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.

Parameters
new_outputs_numberNumber of outputs.

Definition at line 331 of file outputs.cpp.

void OpenNN::Outputs::set ( const Vector< Item > &  new_items)

Sets all the outputs from a single vector of items.

Parameters
new_itemsOutput 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.

Parameters
other_outputsOutputs 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.

Parameters
indexIndex of output variable.
new_descriptionNew 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.

Parameters
new_descriptionsNew 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.

Parameters
new_displayDisplay 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:

  • Name of output variables.
  • Units of output variables.
  • Description of output variables.
Parameters
new_informationOutput 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.

Parameters
indexIndex of output variable.
new_nameNew 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.

Parameters
new_namesNew 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.

Parameters
new_outputs_numberNumber 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.

Parameters
indexIndex of output variable.
new_unitsNew 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.

Parameters
new_unitsNew units for the output variables.

Definition at line 476 of file outputs.cpp.

tinyxml2::XMLDocument * OpenNN::Outputs::to_XML ( void  ) const
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:

  • output_1
  • ...
  • output_n

Definition at line 708 of file outputs.cpp.


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