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

#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)
 
Inputsoperator= (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< Itemitems
 
bool display
 

Detailed Description

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.

Definition at line 41 of file inputs.h.

Constructor & Destructor Documentation

OpenNN::Inputs::Inputs ( void  )
explicit

Default constructor. It creates an inputs object with zero inputs.

Definition at line 26 of file inputs.cpp.

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

Parameters
new_inputs_numberNumber of inputs.

Definition at line 39 of file inputs.cpp.

OpenNN::Inputs::Inputs ( const tinyxml2::XMLDocument &  document)
explicit

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

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

Parameters
other_inputsInputs object to be copied.

Definition at line 63 of file inputs.cpp.

Member Function Documentation

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.

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

Deserializes a TinyXML document into this inputs object.

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

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

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

Parameters
indexIndex of input variable.

Definition at line 219 of file inputs.cpp.

Inputs & OpenNN::Inputs::operator= ( const Inputs other_inputs)

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

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

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

Parameters
new_inputs_numberNumber of inputs.

Definition at line 349 of file inputs.cpp.

void OpenNN::Inputs::set ( const Vector< Vector< std::string > > &  new_inputs_information)

Sets all the inputs from a single vector.

Parameters
new_inputs_informationInputs information. The format is a vector of 3 subvectors:

Definition at line 380 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.

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

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

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

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

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

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

Parameters
iIndex of input variable.
new_nameNew 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.

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

Parameters
indexIndex of input variable.
new_unitNew 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.

Parameters
new_unitsNew units for the input variables.

Definition at line 520 of file inputs.cpp.

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

  • 1
  • ...
  • n

Definition at line 767 of file inputs.cpp.


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