OpenNN::NeuralNetwork Class Reference

#include <neural_network.h>

List of all members.

Public Member Functions

 NeuralNetwork (void)
 NeuralNetwork (const MultilayerPerceptron &)
 NeuralNetwork (const Vector< unsigned int > &)
 NeuralNetwork (const unsigned int &, const unsigned int &)
 NeuralNetwork (const unsigned int &, const unsigned int &, const unsigned int &)
 NeuralNetwork (const unsigned int &)
 NeuralNetwork (const std::string &)
 NeuralNetwork (const NeuralNetwork &)
virtual ~NeuralNetwork (void)
NeuralNetworkoperator= (const NeuralNetwork &)
bool operator== (const NeuralNetwork &) const
MultilayerPerceptronget_multilayer_perceptron_pointer (void) const
InputsOutputsInformationget_inputs_outputs_information_pointer (void) const
ScalingLayerget_scaling_layer_pointer (void) const
UnscalingLayerget_unscaling_layer_pointer (void) const
BoundingLayerget_bounding_layer_pointer (void) const
ProbabilisticLayerget_probabilistic_layer_pointer (void) const
ConditionsLayerget_conditions_layer_pointer (void) const
IndependentParametersget_independent_parameters_pointer (void) const
const bool & get_multilayer_perceptron_flag (void) const
const bool & get_scaling_layer_flag (void) const
const bool & get_unscaling_layer_flag (void) const
const bool & get_bounding_layer_flag (void) const
const bool & get_probabilistic_layer_flag (void) const
const bool & get_conditions_layer_flag (void) const
const bool & get_display (void) const
void set (void)
void set (const MultilayerPerceptron &)
void set (const Vector< unsigned int > &)
void set (const unsigned int &, const unsigned int &)
void set (const unsigned int &, const unsigned int &, const unsigned int &)
void set (const unsigned int &)
void set (const std::string &)
void set (const NeuralNetwork &)
virtual void set_default (void)
void set_multilayer_perceptron_pointer (MultilayerPerceptron *)
void set_scaling_layer_pointer (ScalingLayer *)
void set_unscaling_layer_pointer (UnscalingLayer *)
void set_bounding_layer_pointer (BoundingLayer *)
void set_probabilistic_layer_pointer (ProbabilisticLayer *)
void set_conditions_layer_pointer (ConditionsLayer *)
void set_inputs_outputs_information_pointer (InputsOutputsInformation *)
void set_independent_parameters_pointer (IndependentParameters *)
void set_multilayer_perceptron_flag (const bool &)
void set_scaling_layer_flag (const bool &)
void set_unscaling_layer_flag (const bool &)
void set_scaling_unscaling_layers_flag (const bool &)
void set_bounding_layer_flag (const bool &)
void set_probabilistic_layer_flag (const bool &)
void set_conditions_layer_flag (const bool &)
void set_display (const bool &)
void construct_multilayer_perceptron (void)
void construct_scaling_layer (void)
void construct_unscaling_layer (void)
void construct_bounding_layer (void)
void construct_probabilistic_layer (void)
void construct_conditions_layer (void)
void construct_inputs_outputs_information (void)
void construct_independent_parameters (void)
void destruct_multilayer_perceptron (void)
void destruct_scaling_layer (void)
void destruct_unscaling_layer (void)
void destruct_bounding_layer (void)
void destruct_probabilistic_layer (void)
void destruct_conditions_layer (void)
void destruct_inputs_outputs_information (void)
void destruct_independent_parameters (void)
void delete_pointers (void)
void initialize_random (void)
unsigned int count_layers_number (void)
unsigned int count_parameters_number (void) const
Vector< double > arrange_parameters (void) const
void set_parameters (const Vector< double > &)
void initialize_parameters (const double &)
void initialize_parameters_uniform (void)
void initialize_parameters_uniform (const double &, const double &)
void initialize_parameters_uniform (const Vector< double > &, const Vector< double > &)
void initialize_parameters_uniform (const Vector< Vector< double > > &)
void initialize_parameters_normal (void)
void initialize_parameters_normal (const double &, const double &)
void initialize_parameters_normal (const Vector< double > &, const Vector< double > &)
void initialize_parameters_normal (const Vector< Vector< double > > &)
double calculate_parameters_norm (void) const
Vector< double > calculate_outputs (const Vector< double > &) const
Matrix< double > calculate_Jacobian (const Vector< double > &) const
Vector< Matrix< double > > calculate_Hessian_form (const Vector< double > &) const
Vector< double > calculate_parameters_output (const Vector< double > &, const Vector< double > &) const
Matrix< double > calculate_parameters_Jacobian (const Vector< double > &, const Vector< double > &) const
Vector< Matrix< double > > calculate_parameters_Hessian_form (const Vector< double > &, const Vector< double > &) const
Matrix< double > calculate_output_data (const Matrix< double > &) const
Vector< Vector< std::string > > arrange_inputs_outputs_information (void)
void set_inputs_outputs_information (const Vector< Vector< std::string > > &)
Vector< Vector< double > > arrange_inputs_outputs_statistics (void)
void set_inputs_outputs_statistics (const Vector< Vector< double > > &)
void set_inputs_outputs_minimums_maximums (const Vector< Vector< double > > &)
void set_inputs_outputs_means_standard_deviations (const Vector< Vector< double > > &)
void set_inputs_scaling_outputs_unscaling_methods (const std::string &)
std::string to_string (void) const
virtual TiXmlElement * to_XML (void) const
virtual void from_XML (TiXmlElement *)
void print (void) const
void save (const std::string &) const
void save_parameters (const std::string &) const
virtual void load (const std::string &)
void load_parameters (const std::string &)
void save_data (const std::string &) const
std::string write_expression (void) const
void save_expression (const std::string &)

Protected Attributes

MultilayerPerceptronmultilayer_perceptron_pointer
ScalingLayerscaling_layer_pointer
UnscalingLayerunscaling_layer_pointer
BoundingLayerbounding_layer_pointer
ProbabilisticLayerprobabilistic_layer_pointer
ConditionsLayerconditions_layer_pointer
InputsOutputsInformationinputs_outputs_information_pointer
IndependentParametersindependent_parameters_pointer
bool multilayer_perceptron_flag
bool scaling_layer_flag
bool unscaling_layer_flag
bool bounding_layer_flag
bool probabilistic_layer_flag
bool conditions_layer_flag
bool display


Detailed Description

This class represents the concept of neural network in the OpenNN library. A neural network here is defined as a multilayer perceptron extended with a scaling layer, an unscaling layer, a bounding layer, a probabilistic layer, a conditions layer and a set of independent parameters. This neural network is used to span a function space for the variational problem at hand.

Definition at line 48 of file neural_network.h.


Constructor & Destructor Documentation

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

Default constructor. It creates an empty neural network object. All pointers in the object are initialized to NULL. The rest of members are initialized to their default values.

Definition at line 43 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const MultilayerPerceptron new_multilayer_perceptron  )  [explicit]

Multilayer Perceptron constructor. It creates a neural network object from a given multilayer perceptron. The rest of pointers are initialized to NULL. This constructor also initializes the rest of class members to their default values.

Definition at line 64 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const Vector< unsigned int > &  new_multilayer_perceptron_architecture  )  [explicit]

Multilayer perceptron architecture constructor. It creates a neural network object with a multilayer perceptron given by its architecture. The rest of pointers are initialized to NULL. This constructor also initializes the rest of class members to their default values.

Parameters:
new_multilayer_perceptron_architecture Vector with the number of inputs and the numbers of perceptrons in each layer. The size of this vector must be equal to one plus the number of layers.

Definition at line 89 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const unsigned int &  new_inputs_number,
const unsigned int &  new_perceptrons_number 
) [explicit]

One layer constructor. It creates a one-layer perceptron object. The number of independent parameters is set to zero. The multilayer perceptron parameters are initialized at random.

Parameters:
new_inputs_number Number of inputs in the layer.
new_perceptrons_number Number of perceptrons in the layer.

Definition at line 114 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const unsigned int &  new_inputs_number,
const unsigned int &  new_hidden_perceptrons_number,
const unsigned int &  new_output_perceptrons_number 
) [explicit]

Two layers constructor. It creates a neural network object with a two layers perceptron. The rest of pointers of this object are initialized to NULL. The other members are initialized to their default values.

Parameters:
new_inputs_number Number of inputs in the multilayer perceptron
new_hidden_perceptrons_number Number of neurons in the hidden layer of the multilayer perceptron
new_output_perceptrons_number Number of outputs neurons.

Definition at line 140 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const unsigned int &  new_independent_parameters_number  )  [explicit]

Independent parameters constructor. It creates a neural network with only independent parameters. The independent parameters are initialized at random.

Parameters:
new_independent_parameters_number Number of independent parameters associated to the multilayer perceptron

Definition at line 163 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const std::string &  filename  )  [explicit]

File constructor. It creates a neural network object by loading its members from an XML-type file. Please be careful with the format of that file, which is specified in the OpenNN manual.

Parameters:
filename Name of neural network file.

Definition at line 186 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const NeuralNetwork other_neural_network  ) 

Copy constructor. It creates a copy of an existing neural network object.

Parameters:
other_neural_network Neural network object to be copied.

Definition at line 206 of file neural_network.cpp.

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

Destructor.

Definition at line 224 of file neural_network.cpp.


Member Function Documentation

NeuralNetwork & OpenNN::NeuralNetwork::operator= ( const NeuralNetwork other_neural_network  ) 

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

Parameters:
other_neural_network Neural network object to be assigned.

Definition at line 243 of file neural_network.cpp.

bool OpenNN::NeuralNetwork::operator== ( const NeuralNetwork other_neural_network  )  const

Equal to operator.

Parameters:
other_neural_network Neural network object to be assigned.

Definition at line 287 of file neural_network.cpp.

MultilayerPerceptron * OpenNN::NeuralNetwork::get_multilayer_perceptron_pointer ( void   )  const

This method returns a pointer to the multilayer perceptron composing this neural network.

Definition at line 319 of file neural_network.cpp.

InputsOutputsInformation * OpenNN::NeuralNetwork::get_inputs_outputs_information_pointer ( void   )  const

This method returns a pointer to the inputs outputs information object composing this neural network.

Definition at line 379 of file neural_network.cpp.

ScalingLayer * OpenNN::NeuralNetwork::get_scaling_layer_pointer ( void   )  const

This method returns a pointer to the scaling layer composing this neural network.

Definition at line 329 of file neural_network.cpp.

UnscalingLayer * OpenNN::NeuralNetwork::get_unscaling_layer_pointer ( void   )  const

This method returns a pointer to the unscaling layer composing this neural network.

Definition at line 339 of file neural_network.cpp.

BoundingLayer * OpenNN::NeuralNetwork::get_bounding_layer_pointer ( void   )  const

This method returns a pointer to the bounding layer composing this neural network.

Definition at line 349 of file neural_network.cpp.

ProbabilisticLayer * OpenNN::NeuralNetwork::get_probabilistic_layer_pointer ( void   )  const

This method returns a pointer to the probabilistic layer composing this neural network.

Definition at line 359 of file neural_network.cpp.

ConditionsLayer * OpenNN::NeuralNetwork::get_conditions_layer_pointer ( void   )  const

This method returns a pointer to the conditions layer composing this neural network.

Definition at line 369 of file neural_network.cpp.

IndependentParameters * OpenNN::NeuralNetwork::get_independent_parameters_pointer ( void   )  const

This method returns a pointer to the independent parameters object composing this neural network.

Definition at line 389 of file neural_network.cpp.

const bool & OpenNN::NeuralNetwork::get_multilayer_perceptron_flag ( void   )  const

This method returns the flag used by the neural network to apply the multilayer perceptron or not.

Definition at line 399 of file neural_network.cpp.

const bool & OpenNN::NeuralNetwork::get_scaling_layer_flag ( void   )  const

This method returns the flag used by the neural network to apply the scaling layer or not.

Definition at line 409 of file neural_network.cpp.

const bool & OpenNN::NeuralNetwork::get_unscaling_layer_flag ( void   )  const

This method returns the flag used by the neural network to apply the unscaling layer or not.

Definition at line 419 of file neural_network.cpp.

const bool & OpenNN::NeuralNetwork::get_bounding_layer_flag ( void   )  const

This method returns the flag used by the neural network to apply the bounding layer or not.

Definition at line 429 of file neural_network.cpp.

const bool & OpenNN::NeuralNetwork::get_probabilistic_layer_flag ( void   )  const

This method returns the flag used by the neural network to apply the probabilistic layer or not.

Definition at line 439 of file neural_network.cpp.

const bool & OpenNN::NeuralNetwork::get_conditions_layer_flag ( void   )  const

This method returns the flag used by the neural network to apply the conditions layer or not.

Definition at line 449 of file neural_network.cpp.

const bool & OpenNN::NeuralNetwork::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 460 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set ( void   ) 

This method deletes all the pointers in the neural network. It also sets the rest of members to their default values.

Definition at line 471 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set ( const MultilayerPerceptron new_multilayer_perceptron  ) 

This method deletes all the pointers in the neural network and then constructs a copy of an exisiting multilayer perceptron. It also sets the rest of members to their default values.

Parameters:
new_multilayer_perceptron Multilayer perceptron object to be copied.

Definition at line 485 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set ( const Vector< unsigned int > &  new_multilayer_perceptron_architecture  ) 

This method sets a new neural network with a given multilayer perceptron architecture. It also sets the rest of members to their default values.

Parameters:
new_multilayer_perceptron_architecture Architecture of the multilayer perceptron.

Definition at line 501 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set ( const unsigned int &  new_inputs_number,
const unsigned int &  new_outputs_number 
)

This method sets a new multilayer_perceptron_pointer architecture with one layer and zero independent parameters. It also sets the rest of members to their default values.

Parameters:
new_inputs_number Number of inputs.
new_outputs_number Number of outputs.

Definition at line 518 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set ( const unsigned int &  new_inputs_number,
const unsigned int &  new_hidden_neurons_number,
const unsigned int &  new_outputs_number 
)

This method sets a new multilayer_perceptron_pointer architecture with one hidden layer and zero independent parameters. It also sets the rest of members to their default values.

Parameters:
new_inputs_number Number of inputs.
new_hidden_neurons_number Number of neurons in the hidden layer.
new_outputs_number Number of outputs.

Definition at line 536 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set ( const unsigned int &  new_independent_parameters_number  ) 

This method sets a null new multilayer_perceptron_pointer architecture a given number of independent parameters. It also sets the rest of members to their default values.

Parameters:
new_independent_parameters_number Number of independent_parameters_pointer.

Definition at line 552 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set ( const std::string &  filename  ) 

This method sets the neural network members by loading them from a XML file.

Parameters:
filename Neural network XML filename.

Definition at line 567 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set ( const NeuralNetwork other_neural_network  ) 

This method sets the members of this neural network object with those from other neural network object.

Parameters:
other_neural_network Neural network object to be copied.

Definition at line 580 of file neural_network.cpp.

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

This method sets those members which are not pointer to their default values.

Definition at line 650 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_multilayer_perceptron_pointer ( MultilayerPerceptron new_multilayer_perceptron_pointer  ) 

This method sets a new multilayer perceptron within the neural network.

Parameters:
new_multilayer_perceptron_pointer Pointer to a multilayer perceptron object. Note that the neural network destructror will delete this pointer.

Definition at line 669 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_scaling_layer_pointer ( ScalingLayer new_scaling_layer_pointer  ) 

This method sets a new scaling layer within the neural network.

Parameters:
new_scaling_layer_pointer Pointer to a scaling layer object. Note that the neural network destructror will delete this pointer.

Definition at line 686 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_unscaling_layer_pointer ( UnscalingLayer new_unscaling_layer_pointer  ) 

This method sets a new unscaling layer within the neural network.

Parameters:
new_unscaling_layer_pointer Pointer to an unscaling layer object. Note that the neural network destructror will delete this pointer.

Definition at line 703 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_bounding_layer_pointer ( BoundingLayer new_bounding_layer_pointer  ) 

This method sets a new bounding layer within the neural network.

Parameters:
new_bounding_layer_pointer Pointer to a bounding layer object. Note that the neural network destructror will delete this pointer.

Definition at line 720 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_probabilistic_layer_pointer ( ProbabilisticLayer new_probabilistic_layer_pointer  ) 

This method sets a new probabilistic layer within the neural network.

Parameters:
new_probabilistic_layer_pointer Pointer to a probabilistic layer object. Note that the neural network destructror will delete this pointer.

Definition at line 737 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_conditions_layer_pointer ( ConditionsLayer new_conditions_layer_pointer  ) 

This method sets a new conditions layer within the neural network.

Parameters:
new_conditions_layer_pointer Pointer to a conditions layer object. Note that the neural network destructror will delete this pointer.

Definition at line 754 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_inputs_outputs_information_pointer ( InputsOutputsInformation new_inputs_outputs_information_pointer  ) 

This method sets a new inputs-outputs information object within the neural network.

Parameters:
new_inputs_outputs_information_pointer Pointer to an inputs-outputs information object. Note that the neural network destructror will delete this pointer.

Definition at line 771 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_independent_parameters_pointer ( IndependentParameters new_independent_parameters_pointer  ) 

This method sets new independent parameters within the neural network.

Parameters:
new_independent_parameters_pointer Pointer to an independent parameters object. Note that the neural network destructror will delete this pointer.

Definition at line 788 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_multilayer_perceptron_flag ( const bool &  new_multilayer_perceptron_flag  ) 

This method sets the flag for using a multilayer perceptron within the neural network or not.

Parameters:
new_multilayer_perceptron_flag True if the multilayer perceptron is to be used, and false otherwise.

Definition at line 804 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_scaling_layer_flag ( const bool &  new_scaling_layer_flag  ) 

This method sets the flag for scaling the inputs to the multilayer perceptron or not.

Parameters:
new_scaling_layer_flag True if the inputs are to be scaled, and false otherwise.

Definition at line 815 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_unscaling_layer_flag ( const bool &  new_unscaling_layer_flag  ) 

This method sets the flag for unscaling the outputs from the multilayer perceptron or not.

Parameters:
new_unscaling_layer_flag True if the outputs are to be unscaled, and false otherwise.

Definition at line 838 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_scaling_unscaling_layers_flag ( const bool &  new_scaling_unscaling_layers_flag  ) 

This method sets a unique flag for scaling the inputs and unscaling the outputs.

Parameters:
new_scaling_unscaling_layers_flag True if the inputs are to be scaled and the outputs unscaled, false otherwise.

Definition at line 861 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_bounding_layer_flag ( const bool &  new_bounding_layer_flag  ) 

This method sets the flag for using a bounding layer for the outputs or not.

Parameters:
new_bounding_layer_flag True if the outputs are to be bounded, and false otherwise.

Definition at line 873 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_probabilistic_layer_flag ( const bool &  new_probabilistic_layer_flag  ) 

This method sets the flag for using a probabilistic layer in the neural network. A probabilistic layer is used if the outputs are to be interpreted as probabilities, and false otherwise.

Parameters:
new_probabilistic_layer_flag Flag for using a probabilistic layer not.

Definition at line 897 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_conditions_layer_flag ( const bool &  new_conditions_layer_flag  ) 

This method sets the flag for applying some boundary conditions defined by a particular and an homogeneous solutions.

Parameters:
new_conditions_layer_flag True if the boundary conditions are to be applied, and false otherwise.

Definition at line 920 of file neural_network.cpp.

void OpenNN::NeuralNetwork::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 1555 of file neural_network.cpp.

void OpenNN::NeuralNetwork::construct_multilayer_perceptron ( void   ) 

This method constructs an empty multilayer perceptron within the neural network. It also sets the corresponding flag to true.

Definition at line 1146 of file neural_network.cpp.

void OpenNN::NeuralNetwork::construct_scaling_layer ( void   ) 

This method constructs a scaling layer within the neural network. The size of the scaling layer is the number of inputs in the multilayer perceptron. It also sets the corresponding flag to true.

Definition at line 1163 of file neural_network.cpp.

void OpenNN::NeuralNetwork::construct_unscaling_layer ( void   ) 

This method constructs an unscaling layer within the neural network. The size of the unscaling layer is the number of outputs in the multilayer perceptron. It also sets the corresponding flag to true.

Definition at line 1187 of file neural_network.cpp.

void OpenNN::NeuralNetwork::construct_bounding_layer ( void   ) 

This method constructs a bounding layer within the neural network. The size of the bounding layer is the number of outputs in the multilayer perceptron. It also sets the corresponding flag to true.

Definition at line 1211 of file neural_network.cpp.

void OpenNN::NeuralNetwork::construct_probabilistic_layer ( void   ) 

This method constructs a probabilistic layer within the neural network. The size of the probabilistic layer is the number of outputs in the multilayer perceptron. It also sets the corresponding flag to true.

Definition at line 1235 of file neural_network.cpp.

void OpenNN::NeuralNetwork::construct_conditions_layer ( void   ) 

This method constructs a conditions layer within the neural network. The number of external inputs in the conditions layer is the number of inputs in the multilayer perceptron. The size fo the conditions layer is the number of outputs in the multilayer perceptron. It also sets the corresponding flag to true.

Definition at line 1260 of file neural_network.cpp.

void OpenNN::NeuralNetwork::construct_inputs_outputs_information ( void   ) 

This method constructs an inputs outputs information object within the neural network. The number of inputs is the number of inputs in the multilayer perceptron. The number of outputs is the number of outputs in the multilayer perceptron.

Definition at line 1286 of file neural_network.cpp.

void OpenNN::NeuralNetwork::construct_independent_parameters ( void   ) 

This method constructs an independent parameters object within the neural network. It sets the number of parameters to zero.

Definition at line 1309 of file neural_network.cpp.

void OpenNN::NeuralNetwork::destruct_multilayer_perceptron ( void   ) 

This method deletes the multilayer perceptron within the neural network. It also sets the corresponding flag to false.

Definition at line 1323 of file neural_network.cpp.

void OpenNN::NeuralNetwork::destruct_scaling_layer ( void   ) 

This method deletes the scaling layer within the neural network. It also sets the corresponding flag to false.

Definition at line 1338 of file neural_network.cpp.

void OpenNN::NeuralNetwork::destruct_unscaling_layer ( void   ) 

This method deletes the unscaling layer within the neural network. It also sets the corresponding flag to false.

Definition at line 1353 of file neural_network.cpp.

void OpenNN::NeuralNetwork::destruct_bounding_layer ( void   ) 

This method deletes the bounding layer within the neural network. It also sets the corresponding flag to false.

Definition at line 1368 of file neural_network.cpp.

void OpenNN::NeuralNetwork::destruct_probabilistic_layer ( void   ) 

This method deletes the probabilistic layer within the neural network. It also sets the corresponding flag to false.

Definition at line 1383 of file neural_network.cpp.

void OpenNN::NeuralNetwork::destruct_conditions_layer ( void   ) 

This method deletes the conditions layer within the neural network. It also sets the corresponding flag to false.

Definition at line 1398 of file neural_network.cpp.

void OpenNN::NeuralNetwork::destruct_inputs_outputs_information ( void   ) 

This method deletes the inputs-outputs information object within the neural network.

Definition at line 1412 of file neural_network.cpp.

void OpenNN::NeuralNetwork::destruct_independent_parameters ( void   ) 

This method deletes the independent parameters object within the neural network.

Definition at line 1424 of file neural_network.cpp.

void OpenNN::NeuralNetwork::delete_pointers ( void   ) 

This method deletes all the pointers composing the neural network:

  • Multilayer perceptron.
  • Scaling layer.
  • Unscaling layer.
  • Bounding layer.
  • Probabilistic layer.
  • Conditions layer.
  • Inputs-outputs information.
  • Independent parameters.

Definition at line 1119 of file neural_network.cpp.

void OpenNN::NeuralNetwork::initialize_random ( void   ) 

This method initializes the neural network at random. This is useful for testing purposes.

Definition at line 1437 of file neural_network.cpp.

unsigned int OpenNN::NeuralNetwork::count_layers_number ( void   ) 

This method returns the number of layers in the neural network. That includes perceptron, scaling, unscaling, bounding, probabilistic or conditions layers.

Definition at line 1566 of file neural_network.cpp.

unsigned int OpenNN::NeuralNetwork::count_parameters_number ( void   )  const

This method returns the number of parameters in the multilayer perceptron The number of parameters is the sum of all the multilayer_perceptron_pointer parameters (biases and synaptic weights) and independent parameters.

Definition at line 945 of file neural_network.cpp.

Vector< double > OpenNN::NeuralNetwork::arrange_parameters ( void   )  const

This method returns the values of the parameters in the multilayer perceptron as a single vector. This contains all the multilayer_perceptron_pointer parameters (biases and synaptic weights) and preprocessed independent parameters.

Definition at line 968 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_parameters ( const Vector< double > &  new_parameters  ) 

This method sets all the parameters (multilayer_perceptron_pointer parameters and independent parameters) from a single vector.

Parameters:
new_parameters New set of parameter values.

Definition at line 1033 of file neural_network.cpp.

void OpenNN::NeuralNetwork::initialize_parameters ( const double &  value  ) 

This method initializes all the neural and the independent parameters with a given value.

Definition at line 1608 of file neural_network.cpp.

void OpenNN::NeuralNetwork::initialize_parameters_uniform ( void   ) 

This method initializes all the parameters in the newtork (biases and synaptic weiths + independent parameters) at random with values comprised between -1 and +1.

Definition at line 1627 of file neural_network.cpp.

void OpenNN::NeuralNetwork::initialize_parameters_uniform ( const double &  minimum,
const double &  maximum 
)

This method initializes all the parameters in the newtork (biases and synaptic weiths + independent parameters) at random with values comprised between a given minimum and a given maximum values.

Parameters:
minimum Minimum initialization value.
maximum Maximum initialization value.

Definition at line 1648 of file neural_network.cpp.

void OpenNN::NeuralNetwork::initialize_parameters_uniform ( const Vector< double > &  minimum,
const Vector< double > &  maximum 
)

This method initializes all the parameters in the newtork (biases and synaptic weiths + independent parameters) at random with values comprised between a different minimum and maximum numbers for each free parameter.

Parameters:
minimum Vector of minimum initialization values.
maximum Vector of maximum initialization values.

Definition at line 1670 of file neural_network.cpp.

void OpenNN::NeuralNetwork::initialize_parameters_uniform ( const Vector< Vector< double > > &  minimum_maximum  ) 

This method initializes all the parameters in the newtork (biases and synaptic weiths + independent parameters) values comprised between a different minimum and maximum numbers for each parameter. Minimum and maximum initialization values are given from a vector of two real vectors. The first element must contain the minimum initialization value for each parameter. The second element must contain the maximum initialization value for each parameter.

Parameters:
minimum_maximum Vector of minimum and maximum initialization vectors.

Definition at line 1693 of file neural_network.cpp.

void OpenNN::NeuralNetwork::initialize_parameters_normal ( void   ) 

This method initializes all the parameters in the neural newtork (biases and synaptic weiths + independent parameters) at random with values chosen from a normal distribution with mean 0 and standard deviation 1.

Definition at line 1712 of file neural_network.cpp.

void OpenNN::NeuralNetwork::initialize_parameters_normal ( const double &  mean,
const double &  standard_deviation 
)

This method initializes all the parameters in the newtork (biases and synaptic weiths + independent parameters) at random with values chosen from a normal distribution with a given mean and a given standard deviation.

Parameters:
mean Mean of normal distribution.
standard_deviation Standard deviation of normal distribution.

Definition at line 1734 of file neural_network.cpp.

void OpenNN::NeuralNetwork::initialize_parameters_normal ( const Vector< double > &  mean,
const Vector< double > &  standard_deviation 
)

This method initializes all the parameters in the neural newtork (biases and synaptic weiths + independent parameters) at random with values chosen from normal distributions with a given mean and a given standard deviation for each parameter.

Parameters:
mean Vector of minimum initialization values.
standard_deviation Vector of maximum initialization values.

Definition at line 1756 of file neural_network.cpp.

void OpenNN::NeuralNetwork::initialize_parameters_normal ( const Vector< Vector< double > > &  mean_standard_deviation  ) 

This method initializes all the parameters in the newtork (biases and synaptic weiths + independent parameters) at random with values chosen from normal distributions with a given mean and a given standard deviation for each parameter. All mean and standard deviation values are given from a vector of two real vectors. The first element must contain the mean value for each parameter. The second element must contain the standard deviation value for each parameter.

Parameters:
mean_standard_deviation Mean and standard deviation vectors.

Definition at line 1780 of file neural_network.cpp.

double OpenNN::NeuralNetwork::calculate_parameters_norm ( void   )  const

This method returns the norm of the vector of parameters.

Definition at line 1798 of file neural_network.cpp.

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

This method calculates the outputs vector from the multilayer perceptron in response to an inputs vector. The activity for that is the following:

  • Check inputs range.
  • Calculate scaled inputs.
  • Calculate forward propagation.
  • Calculate unscaled outputs.
  • Apply boundary condtions.
  • Calculate bounded outputs.
Parameters:
inputs Set of inputs to the multilayer perceptron

Definition at line 1822 of file neural_network.cpp.

Matrix< double > OpenNN::NeuralNetwork::calculate_Jacobian ( const Vector< double > &  inputs  )  const

This method returns the Jacobian Matrix of the multilayer perceptron for a set of inputs, corresponding to the point in inputs space at which the Jacobian Matrix is to be found. It uses a forward-propagation method.

Parameters:
inputs Set of inputs to the multilayer perceptron
Todo:

Definition at line 2003 of file neural_network.cpp.

Vector< Matrix< double > > OpenNN::NeuralNetwork::calculate_Hessian_form ( const Vector< double > &  inputs  )  const

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

Todo:

Definition at line 2157 of file neural_network.cpp.

Vector< double > OpenNN::NeuralNetwork::calculate_parameters_output ( const Vector< double > &  inputs,
const Vector< double > &  parameters 
) const

This method returns which would be the outputs for a given inputs and a set of parameters.

Parameters:
inputs Vector of inputs to the multilayer perceptron
parameters Vector of potential parameters of the neural network.

Definition at line 1902 of file neural_network.cpp.

Matrix< double > OpenNN::NeuralNetwork::calculate_parameters_Jacobian ( const Vector< double > &  inputs,
const Vector< double > &  parameters 
) const

This method returns the partial derivatives of the outputs with respect to the multilayer_perceptron_pointer parameters.

Todo:

Definition at line 2146 of file neural_network.cpp.

Vector< Matrix< double > > OpenNN::NeuralNetwork::calculate_parameters_Hessian_form ( const Vector< double > &  inputs,
const Vector< double > &  parameters 
) const

This method returns the second partial derivatives of the outputs with respect to the multilayer_perceptron_pointer parameters.

Todo:

Definition at line 2168 of file neural_network.cpp.

Matrix< double > OpenNN::NeuralNetwork::calculate_output_data ( const Matrix< double > &  input_data  )  const

This method calculates a set of outputs from the multilayer perceptron in response to a set of inputs. The format is a matrix, where each row is a single inputs vector.

Parameters:
input_data Matrix of inputs to the neural network.

Definition at line 1954 of file neural_network.cpp.

Vector< Vector< std::string > > OpenNN::NeuralNetwork::arrange_inputs_outputs_information ( void   ) 

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

  • Name of input variables.
  • Name of output variables.
  • Units of input variables.
  • Units of output variables.
  • Description of input variables.
  • Description of output variables.

Definition at line 2277 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_inputs_outputs_information ( const Vector< Vector< std::string > > &  new_inputs_outputs_information  ) 

This method sets all the possible information about the inputs and output variables. The format is a vector of vectors of size eight:

  • Name of input variables.
  • Units of input variables.
  • Description of input variables.
  • Name of output variables.
  • Units of output variables.
  • Description of output variables.
Parameters:
new_inputs_outputs_information Input and output variables information.

Definition at line 2188 of file neural_network.cpp.

Vector< Vector< double > > OpenNN::NeuralNetwork::arrange_inputs_outputs_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 input variables.
  • Mean of output variables.
  • Standard deviation of input variables.
  • Standard deviation of output variables.
  • Minimum of input variables.
  • Minimum of output variables.
  • Maximum of input variables.
  • Maximum of output variables.

Definition at line 2327 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_inputs_outputs_statistics ( const Vector< Vector< double > > &  new_inputs_outputs_statistics  ) 

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

  • Minimum of input variables.
  • Maximum of input variables.
  • Mean of input variables.
  • Standard deviation of input variables.
  • Minimum of output variables.
  • Maximum of output variables.
  • Mean of output variables.
  • Standard deviation of output variables.
Parameters:
new_inputs_outputs_statistics Input and output variables statistics.

Definition at line 2611 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_inputs_outputs_minimums_maximums ( const Vector< Vector< double > > &  new_inputs_outputs_minimum_maximum  ) 

This method sets the scaling and unscaling layers minimums and maximums from a single vector. The format is:

  • Inputs minimums.
  • Inputs maximums.
  • Outputs minimums.
  • Outputs maximums.
Parameters:
new_inputs_outputs_minimum_maximum Vector with the minimums and maximums of the input and output variables.

Definition at line 2395 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_inputs_outputs_means_standard_deviations ( const Vector< Vector< double > > &  new_inputs_outputs_mean_standard_deviation  ) 

This method sets the scaling and unscaling layers means and standard deviations from a single vector. The format is:

  • Inputs means.
  • Inputs standard deviations.
  • Outputs means.
  • Outputs standard deviations.
Parameters:
new_inputs_outputs_mean_standard_deviation Vector with the means and standard deviations of the input and output variables.

Definition at line 2496 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_inputs_scaling_outputs_unscaling_methods ( const std::string &  new_inputs_scaling_outputs_unscaling_methods  ) 

This method sets the scaling method of the scaling layer and the unscaling method of the unscaling layer.

Parameters:
new_inputs_scaling_outputs_unscaling_methods Method for scaling inputs and uscaling outputs. It can be "MinimumMaximum" and "MeanStandardDeviation".

Definition at line 2706 of file neural_network.cpp.

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

This method returns a string representation of the current neural network object.

Definition at line 2735 of file neural_network.cpp.

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

This method serializes the neural network 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 2814 of file neural_network.cpp.

void OpenNN::NeuralNetwork::from_XML ( TiXmlElement *  neural_network_element  )  [virtual]

This method deserializes a TinyXML element into this neural network object.

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

Definition at line 2966 of file neural_network.cpp.

void OpenNN::NeuralNetwork::print ( void   )  const

This method prints to the screen the members of a neural network object in a XML-type format.

Definition at line 3231 of file neural_network.cpp.

void OpenNN::NeuralNetwork::save ( const std::string &  filename  )  const

This method saves to a XML-type format file the members of a neural network object.

Parameters:
filename Name of multilayer perceptron XML-type file.

Definition at line 3245 of file neural_network.cpp.

void OpenNN::NeuralNetwork::save_parameters ( const std::string &  filename  )  const

This method saves to a data file the parameters of a neural network object.

Parameters:
filename Name of parameters data file.

Definition at line 3270 of file neural_network.cpp.

void OpenNN::NeuralNetwork::load ( const std::string &  filename  )  [virtual]

This method loads from a XML-type file the members of a neural network object. Please mind about the file format, which is specified in the User's Guide.

Parameters:
filename Name of multilayer perceptron XML-type file.

Definition at line 3301 of file neural_network.cpp.

void OpenNN::NeuralNetwork::load_parameters ( const std::string &  filename  ) 

This method loads the multilayer perceptron parameters from a data file. The format of this file is just a sequence of numbers.

Parameters:
filename Name of parameters data file.

Definition at line 3339 of file neural_network.cpp.

void OpenNN::NeuralNetwork::save_data ( const std::string &  filename  )  const

This method saves a set of input-output values from the neural network to a data file.

Parameters:
filename Name of data file.

Definition at line 3537 of file neural_network.cpp.

std::string OpenNN::NeuralNetwork::write_expression ( void   )  const

Todo:

Definition at line 3370 of file neural_network.cpp.

void OpenNN::NeuralNetwork::save_expression ( const std::string &  filename  ) 

This method saves the mathematical expression represented by the neural network to a text file.

Parameters:
filename Name of expression text file.

Definition at line 3511 of file neural_network.cpp.


Member Data Documentation

Pointer to a multilayer perceptron object.

Definition at line 312 of file neural_network.h.

Pointer to a scaling layer object.

Definition at line 316 of file neural_network.h.

Pointer to an unscaling layer object.

Definition at line 320 of file neural_network.h.

Pointer to a bounding layer object.

Definition at line 324 of file neural_network.h.

Pointer to a probabilistic layer.

Definition at line 328 of file neural_network.h.

Pointer to a conditions object.

Definition at line 332 of file neural_network.h.

Pointer to an inputs-outputs information object.

Definition at line 336 of file neural_network.h.

Pointer to an independent parameters object.

Definition at line 340 of file neural_network.h.

Flag for using a multilayer perceptron.

Definition at line 344 of file neural_network.h.

Flag for using the scaling layer.

Definition at line 348 of file neural_network.h.

Flag for using the unscaling layer.

Definition at line 352 of file neural_network.h.

Flag for using the bounding layer.

Definition at line 356 of file neural_network.h.

Flag for using the probabilistic layer.

Definition at line 360 of file neural_network.h.

Flag for using the conditions layer.

Definition at line 364 of file neural_network.h.

Display messages to screen.

Definition at line 368 of file neural_network.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