OpenNN::BoundingLayer Class Reference

#include <bounding_layer.h>

List of all members.

Public Member Functions

 BoundingLayer (void)
 BoundingLayer (const unsigned int &)
 BoundingLayer (TiXmlElement *)
 BoundingLayer (const BoundingLayer &)
virtual ~BoundingLayer (void)
BoundingLayeroperator= (const BoundingLayer &)
bool operator== (const BoundingLayer &) const
bool is_empty (void) const
unsigned int count_bounding_neurons_number (void) const
const Vector< double > & get_lower_bounds (void) const
double get_lower_bound (const unsigned int &) const
const Vector< double > & get_upper_bounds (void) const
double get_upper_bound (const unsigned int &) const
Vector< Vector< double > * > get_bounds (void)
void set (void)
void set (const unsigned int &)
void set (TiXmlElement *)
void set (const BoundingLayer &)
void set_lower_bounds (const Vector< double > &)
void set_lower_bound (const unsigned int &, const double &)
void set_upper_bounds (const Vector< double > &)
void set_upper_bound (const unsigned int &, const double &)
void set_bounds (const Vector< Vector< double > > &)
void set_display (const bool &)
void set_default (void)
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
Matrix< double > arrange_Jacobian (const Vector< double > &) const
Vector< Matrix< double > > arrange_Hessian_form (const Vector< double > &) const
std::string write_expression (const Vector< std::string > &, const Vector< std::string > &) const
std::string to_string (void) const
TiXmlElement * to_XML (void) const
void from_XML (TiXmlElement *)

Protected Attributes

Vector< double > lower_bounds
Vector< double > upper_bounds
bool display


Detailed Description

This class represents a layer of bounding neurons. A bounding layer is used to ensure that variables will never fall below or above given values.

Definition at line 38 of file bounding_layer.h.


Constructor & Destructor Documentation

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

Default constructor. It creates a bounding layer object with zero bounding neurons.

Definition at line 41 of file bounding_layer.cpp.

OpenNN::BoundingLayer::BoundingLayer ( const unsigned int &  bounding_neurons_number  )  [explicit]

Bounding neurons number constructor. It creates a bounding layer with a given size.

Parameters:
bounding_neurons_number Number of bounding neurons in the layer.

Definition at line 53 of file bounding_layer.cpp.

OpenNN::BoundingLayer::BoundingLayer ( TiXmlElement *  bounding_layer_element  )  [explicit]

XML constructor. It creates a bounding layer and loads its members from a XML element.

Parameters:
bounding_layer_element TinyXML element with the member data.

Definition at line 67 of file bounding_layer.cpp.

OpenNN::BoundingLayer::BoundingLayer ( const BoundingLayer other_bounding_layer  ) 

Copy constructor. It creates a copy of an existing bounding layer object.

Parameters:
other_bounding_layer Bounding layer to be copied.

Definition at line 79 of file bounding_layer.cpp.

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

Destructor. This destructor does not delete any pointer.

Definition at line 90 of file bounding_layer.cpp.


Member Function Documentation

BoundingLayer & OpenNN::BoundingLayer::operator= ( const BoundingLayer other_bounding_layer  ) 

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

Parameters:
other_bounding_layer Bounding layer object to be assigned.

Definition at line 101 of file bounding_layer.cpp.

bool OpenNN::BoundingLayer::operator== ( const BoundingLayer other_bounding_layer  )  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_bounding_layer Bounding layer to be compared with.

Definition at line 123 of file bounding_layer.cpp.

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

This method returns true if the size of the layer is zero, and false otherwise.

Definition at line 142 of file bounding_layer.cpp.

unsigned int OpenNN::BoundingLayer::count_bounding_neurons_number ( void   )  const

This method returns the number of bounding neurons in the layer.

Definition at line 159 of file bounding_layer.cpp.

const Vector< double > & OpenNN::BoundingLayer::get_lower_bounds ( void   )  const

This method returns the lower bounds values of all the bounding neurons in the layer.

Definition at line 169 of file bounding_layer.cpp.

double OpenNN::BoundingLayer::get_lower_bound ( const unsigned int &  i  )  const

This method returns the lower bound value of a single bounding neuron.

Parameters:
i Index of bounding neuron.

Definition at line 180 of file bounding_layer.cpp.

const Vector< double > & OpenNN::BoundingLayer::get_upper_bounds ( void   )  const

This method returns the upper bounds values of all the bounding neurons in the layer.

Definition at line 209 of file bounding_layer.cpp.

double OpenNN::BoundingLayer::get_upper_bound ( const unsigned int &  i  )  const

This method returns the upper bound value of a single bounding neuron.

Parameters:
i Index of bounding neuron.

Definition at line 220 of file bounding_layer.cpp.

Vector< Vector< double > * > OpenNN::BoundingLayer::get_bounds ( void   ) 

This method returns the lower bounds and the upper bounds of all the bounding neurons. The format is a vector of pointers to vectors of size two. The first element contains the lower bound values. The second element contains the upper bound values.

Definition at line 262 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::set ( void   ) 

This method sets the number of bounding neurons to be zero. It also sets the rest of memebers to their default values.

Definition at line 278 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::set ( const unsigned int &  new_bounding_neurons_number  ) 

This method resizes the bounding layer. It also sets the rest of memebers to their default values.

Parameters:
new_bounding_neurons_number Size of the bounding layer.

Definition at line 293 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::set ( TiXmlElement *  bounding_layer_element  ) 

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

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

Definition at line 307 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::set ( const BoundingLayer other_bounding_layer  ) 

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

Parameters:
other_bounding_layer Object to be copied.

Definition at line 318 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::set_lower_bounds ( const Vector< double > &  new_lower_bounds  ) 

This method sets new lower bounds for all the neurons in the layer.

Parameters:
new_lower_bounds New set of lower bounds for the bounding neurons.

Definition at line 333 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::set_lower_bound ( const unsigned int &  index,
const double &  new_lower_bound 
)

This method sets a new lower bound for a single neuron. This value is used for unscaling that variable so that it is not less than the lower bound.

Parameters:
index Index of bounding neuron.
new_lower_bound New lower bound for the neuron with index i.

Definition at line 367 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::set_upper_bounds ( const Vector< double > &  new_upper_bounds  ) 

This method sets new upper bounds for all the bounding neurons. These values are used for unscaling variables so that they are not greater than the upper bounds.

Parameters:
new_upper_bounds New set of upper bounds for the layer.

Definition at line 405 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::set_upper_bound ( const unsigned int &  index,
const double &  new_upper_bound 
)

This method sets a new upper bound for a single neuron. This value is used for unscaling that variable so that it is not greater than the upper bound.

Parameters:
index Index of bounding neuron.
new_upper_bound New upper bound for the bounding neuron with that index.

Definition at line 439 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::set_bounds ( const Vector< Vector< double > > &  new_bounds  ) 

This method sets both the lower bounds and the upper bounds of all the neurons in the layer. The format is a vector of two real vectors. The first element must contain the lower bound values for the bounding neurons. The second element must contain the upper bound values for the bounding neurons. These values are used for unscaling variables so that they are neither less than the lower bounds nor greater than the upper bounds.

Parameters:
new_bounds New set of lower and upper bounds.

Definition at line 480 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::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 528 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::set_default ( void   ) 

This method sets the members to their default values:

  • Display: True.

Definition at line 541 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::initialize_random ( void   ) 

Todo:

Definition at line 551 of file bounding_layer.cpp.

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

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

Parameters:
inputs Set of inputs to the bounding layer.

Definition at line 562 of file bounding_layer.cpp.

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

This method returns the derivatives of the outputs with respect to the inputs.

Parameters:
inputs Set of input values to the bounding layer.

Definition at line 594 of file bounding_layer.cpp.

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

This method returns the second derivatives of the outputs with respect to the inputs.

Parameters:
inputs Set of input values to the bounding layer.

Definition at line 623 of file bounding_layer.cpp.

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

This method arranges a "Jacobian matrix" from a vector of derivatives. The Jacobian matrix is composed of the partial derivatives of the layer outputs with respect to the layer inputs.

Parameters:
derivatives Vector of outputs-inputs derivatives of each bounding neuron.

Definition at line 663 of file bounding_layer.cpp.

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

This method arranges a "Hessian form" vector of matrices from a vector of derivatives. The Hessian form is composed of the second partial derivatives of the layer outputs with respect to the layer inputs.

Definition at line 698 of file bounding_layer.cpp.

std::string OpenNN::BoundingLayer::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 lower and upper bounds functions.

Definition at line 717 of file bounding_layer.cpp.

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

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

Definition at line 737 of file bounding_layer.cpp.

TiXmlElement * OpenNN::BoundingLayer::to_XML ( void   )  const

This method serializes the bounding layer object into a XML element of the TinyXML library. See the OpenNN manual for more information about the format of this element.

Definition at line 755 of file bounding_layer.cpp.

void OpenNN::BoundingLayer::from_XML ( TiXmlElement *  bounding_layer_element  ) 

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

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

Definition at line 810 of file bounding_layer.cpp.


Member Data Documentation

Lower bounds of output variables.

Definition at line 134 of file bounding_layer.h.

Upper bounds of output variables.

Definition at line 138 of file bounding_layer.h.

Display messages to screen.

Definition at line 142 of file bounding_layer.h.


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

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