OpenNN::UnscalingLayer Class Reference

#include <unscaling_layer.h>

List of all members.

Public Types

enum  UnscalingMethod { MinimumMaximum, MeanStandardDeviation }

Public Member Functions

 UnscalingLayer (void)
 UnscalingLayer (const unsigned int &)
 UnscalingLayer (const Vector< Vector< double > > &)
 UnscalingLayer (TiXmlElement *)
 UnscalingLayer (const UnscalingLayer &)
virtual ~UnscalingLayer (void)
UnscalingLayeroperator= (const UnscalingLayer &)
bool operator== (const UnscalingLayer &) const
unsigned int count_unscaling_neurons_number (void) const
const Vector< double > & get_minimums (void) const
const double & get_minimum (const unsigned int &) const
const Vector< double > & get_maximums (void) const
const double & get_maximum (const unsigned int &) const
const Vector< double > & get_means (void) const
const double & get_mean (const unsigned int &) const
const Vector< double > & get_standard_deviations (void) const
const double & get_standard_deviation (const unsigned int &) const
Vector< Vector< double > * > get_minimums_maximums (void)
Vector< Vector< double > * > get_means_standard_deviations (void)
Vector< Vector< double > * > get_statistics (void)
const UnscalingMethodget_unscaling_method (void) const
std::string write_unscaling_method (void) const
const bool & get_display (void) const
void set (void)
void set (const unsigned int &)
void set (const Vector< Vector< double > > &)
void set (TiXmlElement *)
void set (const UnscalingLayer &)
virtual void set_default (void)
void set_minimums (const Vector< double > &)
void set_minimum (const unsigned int &, const double &)
void set_maximums (const Vector< double > &)
void set_maximum (const unsigned int &, const double &)
void set_means (const Vector< double > &)
void set_mean (const unsigned int &, const double &)
void set_standard_deviations (const Vector< double > &)
void set_standard_deviation (const unsigned int &, const double &)
void set_minimums_maximums (const Vector< Vector< double > > &)
void set_means_standard_deviations (const Vector< Vector< double > > &)
void set_statistics (const Vector< Vector< double > > &)
void set_unscaling_method (const UnscalingMethod &)
void set_unscaling_method (const std::string &)
void set_display (const bool &)
bool is_empty (void) const
void initialize_random (void)
Vector< double > calculate_outputs (const Vector< double > &) const
Vector< double > calculate_derivative (const Vector< double > &) const
Vector< double > calculate_second_derivative (const Vector< double > &) const
Vector< double > calculate_minimum_maximum_output (const Vector< double > &) const
Vector< double > calculate_minimum_maximum_derivative (const Vector< double > &) const
Vector< double > calculate_minimum_maximum_second_derivative (const Vector< double > &) const
Vector< double > calculate_mean_standard_deviation_output (const Vector< double > &) const
Vector< double > calculate_mean_standard_deviation_derivative (const Vector< double > &) const
Vector< double > calculate_mean_standard_deviation_second_derivative (const Vector< double > &) const
Matrix< double > arrange_Jacobian (const Vector< double > &) const
Vector< Matrix< double > > arrange_Hessian_form (const Vector< double > &) const
void check_range (const Vector< double > &) const
std::string to_string (void) const
virtual TiXmlElement * to_XML (void) const
virtual void from_XML (TiXmlElement *)
std::string write_minimum_maximum_expression (const Vector< std::string > &, const Vector< std::string > &) const
std::string write_mean_stadard_deviation_expression (const Vector< std::string > &, const Vector< std::string > &) const
std::string write_expression (const Vector< std::string > &, const Vector< std::string > &) const

Protected Attributes

Vector< double > minimums
Vector< double > maximums
Vector< double > means
Vector< double > standard_deviations
UnscalingMethod unscaling_method
bool display


Detailed Description

This class represents a layer of unscaling neurons. Unscaling layers are included in the definition of a neural network. They are used to unnormalize variables so they are in the original range after computer processing.

Definition at line 40 of file unscaling_layer.h.


Member Enumeration Documentation

Enumeration of available methods for input variables, output variables and independent parameters scaling.

Definition at line 81 of file unscaling_layer.h.


Constructor & Destructor Documentation

OpenNN::UnscalingLayer::UnscalingLayer ( void   )  [explicit]

Default constructor.

Definition at line 36 of file unscaling_layer.cpp.

OpenNN::UnscalingLayer::UnscalingLayer ( const unsigned int &  new_unscaling_neurons_number  )  [explicit]

Outputs number constructor.

Definition at line 44 of file unscaling_layer.cpp.

OpenNN::UnscalingLayer::UnscalingLayer ( const Vector< Vector< double > > &  new_statistics  )  [explicit]

Outputs statistics constructor.

Definition at line 52 of file unscaling_layer.cpp.

OpenNN::UnscalingLayer::UnscalingLayer ( TiXmlElement *  unscaling_layer_element  )  [explicit]

XML constructor.

Definition at line 60 of file unscaling_layer.cpp.

OpenNN::UnscalingLayer::UnscalingLayer ( const UnscalingLayer other_unscaling_layer  ) 

Copy constructor.

Definition at line 68 of file unscaling_layer.cpp.

OpenNN::UnscalingLayer::~UnscalingLayer ( void   )  [virtual]

Destructor.

Definition at line 78 of file unscaling_layer.cpp.


Member Function Documentation

UnscalingLayer & OpenNN::UnscalingLayer::operator= ( const UnscalingLayer other_unscaling_layer  ) 

Assignment operator.

Parameters:
other_unscaling_layer Object to be copied.

Definition at line 90 of file unscaling_layer.cpp.

bool OpenNN::UnscalingLayer::operator== ( const UnscalingLayer other_unscaling_layer  )  const

Equal to operator. If compares this object with another object of the same class, and returns true if they are equal, and false otherwise.

Parameters:
other_unscaling_layer Object to be compared with.

Definition at line 118 of file unscaling_layer.cpp.

unsigned int OpenNN::UnscalingLayer::count_unscaling_neurons_number ( void   )  const

This method returns the number of unscaling neurons in this layer.

Definition at line 140 of file unscaling_layer.cpp.

const Vector< double > & OpenNN::UnscalingLayer::get_minimums ( void   )  const

This method returns the minimum values of all the unscaling neurons. Such values are to be used for unscaling variables with the minimums and maximums method.

Definition at line 151 of file unscaling_layer.cpp.

const double & OpenNN::UnscalingLayer::get_minimum ( const unsigned int &  i  )  const

This method returns the minimum value of a single unscaling neuron. Such value is to be used for unscaling that outputs with the minimums and maximums method.

Definition at line 162 of file unscaling_layer.cpp.

const Vector< double > & OpenNN::UnscalingLayer::get_maximums ( void   )  const

This method returns the maximum values of all the unscaling neurons. Such values are to be used for unscaling variables with the minimums and maximums method.

Definition at line 200 of file unscaling_layer.cpp.

const double & OpenNN::UnscalingLayer::get_maximum ( const unsigned int &  i  )  const

This method returns the maximum value of a given unscaling neuron. Such value is to be used for unscaling that outputs with the minimums and maximums method.

Definition at line 211 of file unscaling_layer.cpp.

const Vector< double > & OpenNN::UnscalingLayer::get_means ( void   )  const

This method returns the mean values of all the unscaling neurons. Such values are to be used for unscaling the outputs with the means and standard deviation method.

Definition at line 249 of file unscaling_layer.cpp.

const double & OpenNN::UnscalingLayer::get_mean ( const unsigned int &  index  )  const

This method returns the mean values of a single unscaling neuron.

Parameters:
index Index of the unscaling neuron.

Definition at line 260 of file unscaling_layer.cpp.

const Vector< double > & OpenNN::UnscalingLayer::get_standard_deviations ( void   )  const

This method returns the standard deviation values of all the unscaling neurons. Such values are to be used for unscaling outputs with the mean and standard deviation method.

Definition at line 290 of file unscaling_layer.cpp.

const double & OpenNN::UnscalingLayer::get_standard_deviation ( const unsigned int &  index  )  const

This method returns the standard deviation value of a single neuron in the unscaling layer. Such a value is to be used for unscaling outputs with the means and standard deviation method.

Parameters:
index Index of output variable.

Definition at line 302 of file unscaling_layer.cpp.

Vector< Vector< double > * > OpenNN::UnscalingLayer::get_minimums_maximums ( void   ) 

This method returns the minimums and the maximum values of all the output variables. The format is a vector of pointers to vectors of size two. The first element contains the minimum values of the output variables. The second element contains the maximum values of the output variables. Such values are to be used for unscaling outputs with the minimums and maximums method.

Definition at line 335 of file unscaling_layer.cpp.

Vector< Vector< double > * > OpenNN::UnscalingLayer::get_means_standard_deviations ( void   ) 

This method returns the means and the standard deviation values of all the output variables. The format is a vector of pointers to vectors of size two. The first element contains the mean values of the output variables. The second element contains the standard deviation values of the output variables. Such values are to be used for unscaling outputs with the means and standard deviation method.

Definition at line 354 of file unscaling_layer.cpp.

Vector< Vector< double > * > OpenNN::UnscalingLayer::get_statistics ( void   ) 

This method returns all the available statistics of the inputs and output variables. The format is a vector of pointers to vectors of size ten:

  • Mean of variables.
  • Standard deviation of variables.
  • Minimum of variables.
  • Maximum of variables.

Definition at line 376 of file unscaling_layer.cpp.

const UnscalingLayer::UnscalingMethod & OpenNN::UnscalingLayer::get_unscaling_method ( void   )  const

This method returns the method used for unscaling.

Definition at line 393 of file unscaling_layer.cpp.

std::string OpenNN::UnscalingLayer::write_unscaling_method ( void   )  const

This method returns a string with the name of the method used for unscaling.

Definition at line 403 of file unscaling_layer.cpp.

const bool & OpenNN::UnscalingLayer::get_display ( void   )  const

This method 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 431 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set ( void   ) 

This method sets the unscaling layer to be empty.

Definition at line 441 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set ( const unsigned int &  new_unscaling_neurons_number  ) 

This method sets a new size in the unscaling layer. It also sets the members to their default values.

Definition at line 457 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set ( const Vector< Vector< double > > &  new_statistics  ) 

This method sets the size of the unscaling layer and the statistics values.

Parameters:
new_statistics Vector of vectors containing the minimums, maximums, means and standard deviations for the unscaling layer. The size of this vector must be 4. The size of each subvector will be the size of the unscaling layer.

Definition at line 475 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set ( TiXmlElement *  new_unscaling_layer_element  ) 

This method sets the unscaling layer members from a XML element.

Parameters:
new_unscaling_layer_element Pointer to a Tiny XML element containing the member data.

Definition at line 491 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set ( const UnscalingLayer new_unscaling_layer  ) 

This method sets the members of this object to be the members of another object of the same class.

Definition at line 501 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_default ( void   )  [virtual]

This member sets the default values for the unscaling layer:

  • Minimus: -1 for all unscaling neurons.
  • Maximums: 1 for al unscaling neurons.
  • Means: 0 for all unscaling neurons.
  • Standard deviations 1 for all unscaling neurons.
  • Unscaling method: Minimum and maximum.
  • Display: True.

Definition at line 526 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_minimums ( const Vector< double > &  new_minimums  ) 

This method sets new minimums for all the unscaling neurons. These values are used for unscaling variables with the minimums and maximums method.

Parameters:
new_minimums New set of minimum values for the unscaling neurons.

Definition at line 545 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_minimum ( const unsigned int &  index,
const double &  new_minimum 
)

This method sets a new minimum value for a single unscaling neuron. This value is used for unscaling that variable with the minimums and maximums method.

Parameters:
index Index of unscaling neuron.
new_minimum New minimum value for that neuron.

Definition at line 579 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_maximums ( const Vector< double > &  new_maximums  ) 

This method sets new maximum values for all the unscaling neurons. These values are used for unscaling variables with the minimums and maximums method.

Parameters:
new_maximums New set of maximum values for the unscaling neurons.

Definition at line 617 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_maximum ( const unsigned int &  index,
const double &  new_maximum 
)

This method sets a new maximum value for a single unscaling neuron. This value is used for unscaling that variable with the minimums and maximums method.

Parameters:
index Index of output variable.
new_maximum New maximum value for that output variable.

Definition at line 649 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_means ( const Vector< double > &  new_means  ) 

This method sets new mean values for all the unscaling neurons. These values are used for unscaling variables with the meand and standard deviation method.

Parameters:
new_means New set of mean values for the usncaling neurons.

Definition at line 687 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_mean ( const unsigned int &  index,
const double &  new_mean 
)

This method sets a new mean value for a single unscaling neuron. That value is used for unscaling a variable with the meand and standard deviation method.

Parameters:
index Index of unscaling neuron.
new_mean New mean value for the unscaling neuron with the previous index.

Definition at line 721 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_standard_deviations ( const Vector< double > &  new_standard_deviations  ) 

This method sets new standard deviation values for all the variables. These values are used for unscaling outputs with the meand and standard deviation method.

Parameters:
new_standard_deviations New set of standard deviation values for the variables.

Definition at line 761 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_standard_deviation ( const unsigned int &  index,
const double &  new_standard_deviation 
)

This method sets a new standard deviation value for a single output variable. These values are used for unscaling the outputs form the multilayer perceptron with the meand and standard deviation method.

Parameters:
index Index of output variable.
new_standard_deviation New standard deviation value for that output variable.

Definition at line 796 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_minimums_maximums ( const Vector< Vector< double > > &  new_minimums_maximums  ) 

This method sets both the minimums and the maximum values of all the unscaling neurons. The format is a vector of two real vectors. The first element must contain the minimum values for the variables. The second element must contain the maximum values for the variables. These values are used for unscaling variables with the minimums and maximums method.

Parameters:
new_minimums_maximums Set of minimum and maximum values for the variables.

Definition at line 839 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_means_standard_deviations ( const Vector< Vector< double > > &  new_means_standard_deviations  ) 

This method sets both the means and the standard deviation values of all the variables. The format is a vector of two real vectors. The first element must contain the mean values for the variables. The second element must contain the standard deviation values for the variables.

Parameters:
new_means_standard_deviations Set of mean and standard deviation values for all the variables.

Definition at line 902 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_statistics ( const Vector< Vector< double > > &  new_statistics  ) 

This method sets all the available statistics about the inputs and output variables. The format is a vector of ten real vectors:

  • Mean of input variables.
  • Standard deviation of input variables.
  • Minimum of input variables.
  • Maximum of input variables.
  • Mean of output variables.
  • Standard deviation of output variables.
  • Minimum of output variables.
  • Maximum of output variables.
Parameters:
new_statistics Variables statistics.

Definition at line 956 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_unscaling_method ( const UnscalingMethod new_unscaling_method  ) 

This method sets the method to be used for unscaling the outputs from the multilayer perceptron

Parameters:
new_unscaling_method New unscaling method for the output variables.

Definition at line 1011 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_unscaling_method ( const std::string &  new_unscaling_method  ) 

This method sets the method to be used for unscaling the outputs from the multilayer perceptron The argument is a string containing the name of the method ("None", "MeanStandardDeviation" or "MinimumMaximum").

Parameters:
new_unscaling_method New unscaling method for the output variables.

Definition at line 1023 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::set_display ( const bool &  new_display  ) 

This method 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_display Display value.

Definition at line 1053 of file unscaling_layer.cpp.

bool OpenNN::UnscalingLayer::is_empty ( void   )  const

This method returns true if the number of unscaling neurons is zero, and false otherwise.

Definition at line 1124 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::initialize_random ( void   ) 

Todo:

Definition at line 1143 of file unscaling_layer.cpp.

Vector< double > OpenNN::UnscalingLayer::calculate_outputs ( const Vector< double > &  inputs  )  const

This method calculates the outputs from the unscaling layer for a given set of inputs to that layer.

Parameters:
inputs Set of inputs to the unscaling layer.

Definition at line 1154 of file unscaling_layer.cpp.

Vector< double > OpenNN::UnscalingLayer::calculate_derivative ( const Vector< double > &  inputs  )  const

This method retuns the derivatives of the unscaled outputs with respect to the scaled outputs. That derivatives depend on the method for unscaling the outputs to be used.

Definition at line 1214 of file unscaling_layer.cpp.

Vector< double > OpenNN::UnscalingLayer::calculate_second_derivative ( const Vector< double > &  inputs  )  const

This method retuns the second derivatives of the unscaled outputs with respect to the scaled outputs. That second derivatives depend on the method for unscaling the outputs to be used.

Definition at line 1270 of file unscaling_layer.cpp.

Vector< double > OpenNN::UnscalingLayer::calculate_minimum_maximum_output ( const Vector< double > &  inputs  )  const

This method calculates the outputs from the unscaling layer with the minimum and maximum method for a set of inputs.

Parameters:
inputs Vector of input values to the unscaling layer. The size must be equal to the number of unscaling neurons.

Definition at line 1307 of file unscaling_layer.cpp.

Vector< double > OpenNN::UnscalingLayer::calculate_minimum_maximum_derivative ( const Vector< double > &   )  const

This method calculates the derivatives of the outputs from the unscaling layer with the minimum and maximum method. As the minimum and maximum method is a linear method, the derivatives will not depend on the inputs.

Definition at line 1342 of file unscaling_layer.cpp.

Vector< double > OpenNN::UnscalingLayer::calculate_minimum_maximum_second_derivative ( const Vector< double > &   )  const

This method calculates the second derivatives of the outputs from the unscaling layer with the minimum and maximum method. As the minimum and maximum method is a linear method, the second derivatives will be always zero.

Definition at line 1377 of file unscaling_layer.cpp.

Vector< double > OpenNN::UnscalingLayer::calculate_mean_standard_deviation_output ( const Vector< double > &  inputs  )  const

This method calculates the outputs from the unscaling layer with the mean and standard deviation method for a set of inputs.

Parameters:
inputs Vector of input values to the unscaling layer. The size must be equal to the number of unscaling neurons.

Definition at line 1392 of file unscaling_layer.cpp.

Vector< double > OpenNN::UnscalingLayer::calculate_mean_standard_deviation_derivative ( const Vector< double > &   )  const

This method calculates the derivatives of the outputs from the unscaling layer with the mean and standard deviation method. As the minimum and maximum method is a linear method, the derivatives will not depend on the inputs.

Definition at line 1427 of file unscaling_layer.cpp.

Vector< double > OpenNN::UnscalingLayer::calculate_mean_standard_deviation_second_derivative ( const Vector< double > &   )  const

This method calculates the second derivatives of the outputs from the unscaling layer with the mean and standard deviation method. As the minimum and maximum method is a linear method, the second derivatives will be always zero.

Definition at line 1462 of file unscaling_layer.cpp.

Matrix< double > OpenNN::UnscalingLayer::arrange_Jacobian ( const Vector< double > &  derivatives  )  const

This method arranges a "Jacobian" matrix from the vector of derivatives.

Definition at line 1476 of file unscaling_layer.cpp.

Vector< Matrix< double > > OpenNN::UnscalingLayer::arrange_Hessian_form ( const Vector< double > &  second_derivative  )  const

This method arranges a "Hessian form" vector of matrices from the vector of second derivatives.

Definition at line 1492 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::check_range ( const Vector< double > &  outputs  )  const

This method checks whether the outptus from the unscaling layer are inside the range defined by the minimums and maximum values. It displays a warning message if they are outside.

Parameters:
outputs Set of outptus from the unscaling layer.

Definition at line 1065 of file unscaling_layer.cpp.

std::string OpenNN::UnscalingLayer::to_string ( void   )  const

This method returns a string representation of the current unscaling layer object.

Definition at line 1512 of file unscaling_layer.cpp.

TiXmlElement * OpenNN::UnscalingLayer::to_XML ( void   )  const [virtual]

This method serializes this unscaling layer object into a TinyXML element. Please read the OpenNN manual for more information about this.

Definition at line 1533 of file unscaling_layer.cpp.

void OpenNN::UnscalingLayer::from_XML ( TiXmlElement *  unscaling_layer_element  )  [virtual]

This method deserializes a TinyXML element into this unscaling layer object.

Parameters:
unscaling_layer_element Pointer to a XML element containing the member data.

Definition at line 1606 of file unscaling_layer.cpp.

std::string OpenNN::UnscalingLayer::write_minimum_maximum_expression ( const Vector< std::string > &  inputs_name,
const Vector< std::string > &  outputs_name 
) const

This method returns a string with the expression of the unscaling process with the minimum and maximum method.

Parameters:
inputs_name Name of inputs to the unscaling layer. The size of this vector must be equal to the number of unscaling neurons.
outputs_name Name of outputs from the unscaling layer. The size of this vector must be equal to the number of unscaling neurons.

Definition at line 1758 of file unscaling_layer.cpp.

std::string OpenNN::UnscalingLayer::write_mean_stadard_deviation_expression ( const Vector< std::string > &  inputs_name,
const Vector< std::string > &  outputs_name 
) const

This method returns a string with the expression of the unscaling process with the mean and standard deviation method.

Parameters:
inputs_name Name of inputs to the unscaling layer. The size of this vector must be equal to the number of unscaling neurons.
outputs_name Name of outputs from the unscaling layer. The size of this vector must be equal to the number of unscaling neurons.

Definition at line 1779 of file unscaling_layer.cpp.

std::string OpenNN::UnscalingLayer::write_expression ( const Vector< std::string > &  inputs_name,
const Vector< std::string > &  outputs_name 
) const

This method returns a string with the expression of the unscaling process in this layer.

Parameters:
inputs_name Name of inputs to the unscaling layer. The size of this vector must be equal to the number of unscaling neurons.
outputs_name Name of outputs from the unscaling layer. The size of this vector must be equal to the number of unscaling neurons.

Definition at line 1800 of file unscaling_layer.cpp.


Member Data Documentation

Minimum of output variables.

Definition at line 199 of file unscaling_layer.h.

Maximum of output variables.

Definition at line 203 of file unscaling_layer.h.

Mean of output variables.

Definition at line 207 of file unscaling_layer.h.

Standard deviation of output variables.

Definition at line 211 of file unscaling_layer.h.

Unscaling method for the output variables.

Definition at line 215 of file unscaling_layer.h.

Display warning messages to screen.

Definition at line 219 of file unscaling_layer.h.


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

Generated on Sun Aug 26 11:58:18 2012 for OpenNN by  doxygen 1.5.9