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

#include <neural_network.h>

Public Member Functions

 NeuralNetwork (void)
 
 NeuralNetwork (const MultilayerPerceptron &)
 
 NeuralNetwork (const Vector< size_t > &)
 
 NeuralNetwork (const size_t &, const size_t &)
 
 NeuralNetwork (const size_t &, const size_t &, const size_t &)
 
 NeuralNetwork (const size_t &)
 
 NeuralNetwork (const std::string &)
 
 NeuralNetwork (const tinyxml2::XMLDocument &)
 
 NeuralNetwork (const NeuralNetwork &)
 
virtual ~NeuralNetwork (void)
 
NeuralNetworkoperator= (const NeuralNetwork &)
 
bool operator== (const NeuralNetwork &) const
 
bool has_multilayer_perceptron (void) const
 
bool has_inputs (void) const
 
bool has_outputs (void) const
 
bool has_scaling_layer (void) const
 
bool has_unscaling_layer (void) const
 
bool has_bounding_layer (void) const
 
bool has_probabilistic_layer (void) const
 
bool has_conditions_layer (void) const
 
bool has_independent_parameters (void) const
 
MultilayerPerceptronget_multilayer_perceptron_pointer (void) const
 
Inputsget_inputs_pointer (void) const
 
Outputsget_outputs_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_display (void) const
 
void set (void)
 
void set (const MultilayerPerceptron &)
 
void set (const Vector< size_t > &)
 
void set (const size_t &, const size_t &)
 
void set (const size_t &, const size_t &, const size_t &)
 
void set (const size_t &)
 
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_pointer (Inputs *)
 
void set_outputs_pointer (Outputs *)
 
void set_independent_parameters_pointer (IndependentParameters *)
 
void set_display (const bool &)
 
void prune_input (const size_t &)
 
void prune_output (const size_t &)
 
void resize_inputs_number (const size_t &)
 
void resize_outputs_number (const size_t &)
 
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 (void)
 
void construct_outputs (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 (void)
 
void destruct_outputs (void)
 
void destruct_independent_parameters (void)
 
void delete_pointers (void)
 
void initialize_random (void)
 
size_t get_layers_number (void)
 
size_t get_inputs_number (void) const
 
size_t get_outputs_number (void) const
 
Vector< size_t > arrange_architecture (void) const
 
size_t count_parameters_number (void) const
 
Vector< double > arrange_parameters (void) const
 
void set_parameters (const Vector< double > &)
 
void initialize_parameters (const double &)
 
void randomize_parameters_uniform (void)
 
void randomize_parameters_uniform (const double &, const double &)
 
void randomize_parameters_uniform (const Vector< double > &, const Vector< double > &)
 
void randomize_parameters_uniform (const Vector< Vector< double > > &)
 
void randomize_parameters_normal (void)
 
void randomize_parameters_normal (const double &, const double &)
 
void randomize_parameters_normal (const Vector< double > &, const Vector< double > &)
 
void randomize_parameters_normal (const Vector< Vector< double > > &)
 
double calculate_parameters_norm (void) const
 
Statistics< double > calculate_parameters_statistics (void) const
 
Histogram< double > calculate_parameters_histogram (const size_t &=10) 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
 
Matrix< double > calculate_directional_input_data (const size_t &, const Vector< double > &, const double &, const double &, const size_t &=101) const
 
Vector< double > calculate_outputs (const Vector< double > &, const Vector< double > &) const
 
Matrix< double > calculate_Jacobian (const Vector< double > &, const Vector< double > &) const
 
Vector< Matrix< double > > calculate_Hessian_form (const Vector< double > &, const Vector< double > &) const
 
Matrix< double > calculate_output_data (const Matrix< double > &) const
 
Vector< Matrix< double > > calculate_Jacobian_data (const Matrix< double > &) const
 
std::string to_string (void) const
 
virtual tinyxml2::XMLDocument * to_XML (void) const
 
virtual void from_XML (const tinyxml2::XMLDocument &)
 
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
 
Inputsinputs_pointer
 
Outputsoutputs_pointer
 
IndependentParametersindependent_parameters_pointer
 
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 57 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 28 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 50 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const Vector< size_t > &  new_multilayer_perceptron_architecture)
explicit

Multilayer perceptron architecture constructor. It creates a neural network object with a multilayer perceptron given by its architecture. This constructor allows an arbitrary deep learning 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_architectureVector 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 83 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const size_t &  new_inputs_number,
const size_t &  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_numberNumber of inputs in the layer.
new_perceptrons_numberNumber of perceptrons in the layer.

Definition at line 115 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const size_t &  new_inputs_number,
const size_t &  new_hidden_perceptrons_number,
const size_t &  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_numberNumber of inputs in the multilayer perceptron
new_hidden_perceptrons_numberNumber of neurons in the hidden layer of the multilayer perceptron
new_output_perceptrons_numberNumber of outputs neurons.

Definition at line 148 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const size_t &  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_numberNumber of independent parameters associated to the multilayer perceptron

Definition at line 178 of file neural_network.cpp.

OpenNN::NeuralNetwork::NeuralNetwork ( const std::string &  file_name)
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
file_nameName of neural network file.

Definition at line 202 of file neural_network.cpp.

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

XML constructor. It creates a neural network object by loading its members from an XML document.

Parameters
documentTinyXML document containing the neural network data.

Definition at line 223 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_networkNeural network object to be copied.

Definition at line 244 of file neural_network.cpp.

Member Function Documentation

Vector< size_t > OpenNN::NeuralNetwork::arrange_architecture ( void  ) const

Returns a vector with the architecture of the neural network. The elements of this vector are as follows;

  • Number of scaling neurons (if there is a scaling layer).
  • Multilayer perceptron architecture (if there is a multilayer perceptron).
  • Number of conditions neurons (if there is a conditions layer).
  • Number of unscaling neurons (if there is an unscaling layer).
  • Number of probabilistic neurons (if there is a probabilistic layer).
  • Number of bounding neurons (if there is a bounding layer).

Definition at line 1190 of file neural_network.cpp.

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

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

Definition at line 1277 of file neural_network.cpp.

Matrix< double > OpenNN::NeuralNetwork::calculate_directional_input_data ( const size_t &  direction,
const Vector< double > &  point,
const double &  minimum,
const double &  maximum,
const size_t &  points_number = 101 
) const

Calculates the input data which is necessary to compute the output data from the neural network in some direction.

Parameters
directionInput index (must be between 0 and number of inputs - 1).
pointInput point through the directional input passes.
minimumMinimum value of the input with the above index.
maximumMaximum value of the input with the above index.
points_numberNumber of points in the directional input data set.

Definition at line 2318 of file neural_network.cpp.

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

Returns the second partial derivatives of the outputs with respect to the inputs.

Todo:

Definition at line 2669 of file neural_network.cpp.

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

Returns the second partial derivatives of the outputs with respect to the neural network parameters.

Todo:

Definition at line 2680 of file neural_network.cpp.

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

Returns the Jacobian Matrix of the neural network 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
inputsSet of inputs to the neural network.

Definition at line 2489 of file neural_network.cpp.

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

Returns the partial derivatives of the outputs with respect to a given set of parameters.

Todo:

Definition at line 2658 of file neural_network.cpp.

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

Calculates a set of Jacobians from the neural network in response to a set of inputs. The format is a vector of matrices, where each element is the Jacobian matrix for a single input.

Parameters
input_dataMatrix of inputs to the neural network.

Definition at line 2632 of file neural_network.cpp.

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

Calculates a set of outputs from the neural network in response to a set of inputs. The format is a matrix, where each row contains the output for a single input.

Parameters
input_dataMatrix of inputs to the neural network.

Definition at line 2441 of file neural_network.cpp.

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

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
inputsSet of inputs to the neural network.

Definition at line 2235 of file neural_network.cpp.

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

Returns which would be the outputs for a given inputs and a set of parameters.

Parameters
inputsVector of inputs to the neural network.
parametersVector of potential parameters of the neural network.

Definition at line 2349 of file neural_network.cpp.

Histogram< double > OpenNN::NeuralNetwork::calculate_parameters_histogram ( const size_t &  bins_number = 10) const

Returns a histogram structure of the parameters vector. That will be used for looking at the distribution of the parameters.

Parameters
bins_numberNumber of bins in the histogram (10 by default).

Definition at line 2213 of file neural_network.cpp.

Statistics< double > OpenNN::NeuralNetwork::calculate_parameters_statistics ( void  ) const

Returns a statistics structure of the parameters vector. That contains the minimum, maximum, mean and standard deviation values of the parameters.

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

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

Definition at line 1521 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 1586 of file neural_network.cpp.

void OpenNN::NeuralNetwork::construct_inputs ( void  )

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

Definition at line 1544 of file neural_network.cpp.

void OpenNN::NeuralNetwork::construct_outputs ( void  )

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

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

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

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

Definition at line 1457 of file neural_network.cpp.

size_t OpenNN::NeuralNetwork::count_parameters_number ( void  ) const

Returns the number of parameters in the multilayer perceptron The number of parameters is the sum of all the multilayer perceptron parameters (biases and synaptic weights) and independent parameters.

Definition at line 1254 of file neural_network.cpp.

void OpenNN::NeuralNetwork::delete_pointers ( void  )

This method deletes all the pointers composing the neural network:

  • Inputs.
  • Outputs.
  • Multilayer perceptron.
  • Scaling layer.
  • Unscaling layer.
  • Bounding layer.
  • Probabilistic layer.
  • Conditions layer.
  • Independent parameters.

Definition at line 1394 of file neural_network.cpp.

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

Deserializes a TinyXML document into this neural network object.

Parameters
documentXML document containing the member data.

Definition at line 2945 of file neural_network.cpp.

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

size_t OpenNN::NeuralNetwork::get_layers_number ( void  )

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

Definition at line 1952 of file neural_network.cpp.

bool OpenNN::NeuralNetwork::has_bounding_layer ( void  ) const

Returns true if the neural network object has a bounding layer object inside, and false otherwise.

Definition at line 438 of file neural_network.cpp.

bool OpenNN::NeuralNetwork::has_conditions_layer ( void  ) const

Returns true if the neural network object has a conditions layer object inside, and false otherwise.

Definition at line 474 of file neural_network.cpp.

bool OpenNN::NeuralNetwork::has_independent_parameters ( void  ) const

Returns true if the neural network object has an independent parameters object inside, and false otherwise.

Definition at line 492 of file neural_network.cpp.

bool OpenNN::NeuralNetwork::has_inputs ( void  ) const

Returns true if the neural network object has an inputs object inside, and false otherwise.

Definition at line 366 of file neural_network.cpp.

bool OpenNN::NeuralNetwork::has_multilayer_perceptron ( void  ) const

Returns true if the neural network object has a multilayer perceptron object inside, and false otherwise.

Definition at line 348 of file neural_network.cpp.

bool OpenNN::NeuralNetwork::has_outputs ( void  ) const

Returns true if the neural network object has an outputs object inside, and false otherwise.

Definition at line 384 of file neural_network.cpp.

bool OpenNN::NeuralNetwork::has_probabilistic_layer ( void  ) const

Returns true if the neural network object has a probabilistic layer object inside, and false otherwise.

Definition at line 456 of file neural_network.cpp.

bool OpenNN::NeuralNetwork::has_scaling_layer ( void  ) const

Returns true if the neural network object has a scaling layer object inside, and false otherwise.

Definition at line 402 of file neural_network.cpp.

bool OpenNN::NeuralNetwork::has_unscaling_layer ( void  ) const

Returns true if the neural network object has an unscaling layer object inside, and false otherwise.

Definition at line 420 of file neural_network.cpp.

void OpenNN::NeuralNetwork::initialize_random ( void  )

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

Definition at line 1708 of file neural_network.cpp.

void OpenNN::NeuralNetwork::load ( const std::string &  file_name)
virtual

Loads from a XML file the members for this neural network object. Please mind about the file format, which is specified in the User's Guide.

Parameters
file_nameName of neural network XML file.

Definition at line 3243 of file neural_network.cpp.

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

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

Parameters
file_nameName of parameters data file.

Definition at line 3270 of file neural_network.cpp.

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_networkNeural network object to be assigned.

Definition at line 283 of file neural_network.cpp.

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

Equal to operator.

Parameters
other_neural_networkNeural network object to be compared with.

Definition at line 319 of file neural_network.cpp.

void OpenNN::NeuralNetwork::prune_input ( const size_t &  index)

Removes a given input to the neural network. This involves removing the input itself and the corresponding scaling layer, conditions layer and multilayer perceptron inputs.

Parameters
indexIndex of input to be pruned.

Definition at line 1848 of file neural_network.cpp.

void OpenNN::NeuralNetwork::prune_output ( const size_t &  index)

Removes a given output from the neural network. This involves removing the output itself and the corresponding unscaling layer, conditions layer, probabilistic layer, bounding layer and multilayer perceptron outputs.

Parameters
indexIndex of output to be pruned.

Definition at line 1886 of file neural_network.cpp.

void OpenNN::NeuralNetwork::randomize_parameters_normal ( void  )

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 2098 of file neural_network.cpp.

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

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
meanMean of normal distribution.
standard_deviationStandard deviation of normal distribution.

Definition at line 2120 of file neural_network.cpp.

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

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
meanVector of minimum initialization values.
standard_deviationVector of maximum initialization values.

Definition at line 2142 of file neural_network.cpp.

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

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_deviationMean and standard deviation vectors.

Definition at line 2166 of file neural_network.cpp.

void OpenNN::NeuralNetwork::randomize_parameters_uniform ( void  )

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 2013 of file neural_network.cpp.

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

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
minimumMinimum initialization value.
maximumMaximum initialization value.

Definition at line 2034 of file neural_network.cpp.

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

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
minimumVector of minimum initialization values.
maximumVector of maximum initialization values.

Definition at line 2056 of file neural_network.cpp.

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

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_maximumVector of minimum and maximum initialization vectors.

Definition at line 2079 of file neural_network.cpp.

void OpenNN::NeuralNetwork::resize_inputs_number ( const size_t &  )
Todo:

Definition at line 1931 of file neural_network.cpp.

void OpenNN::NeuralNetwork::resize_outputs_number ( const size_t &  )
Todo:

Definition at line 1941 of file neural_network.cpp.

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

Saves to a XML file the members of a neural network object.

Parameters
file_nameName of neural network XML file.

Definition at line 3197 of file neural_network.cpp.

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

Saves a set of input-output values from the neural network to a data file.

Parameters
file_nameName of data file.

Definition at line 3499 of file neural_network.cpp.

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

Saves the mathematical expression represented by the neural network to a text file.

Parameters
file_nameName of expression text file.

Definition at line 3473 of file neural_network.cpp.

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

Saves to a data file the parameters of a neural network object.

Parameters
file_nameName of parameters data file.

Definition at line 3212 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 746 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_perceptronMultilayer perceptron object to be copied.

Definition at line 760 of file neural_network.cpp.

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

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_architectureArchitecture of the multilayer perceptron.

Definition at line 784 of file neural_network.cpp.

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

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_numberNumber of inputs.
new_outputs_numberNumber of outputs.

Definition at line 809 of file neural_network.cpp.

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

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_numberNumber of inputs.
new_hidden_neurons_numberNumber of neurons in the hidden layer.
new_outputs_numberNumber of outputs.

Definition at line 831 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set ( const size_t &  new_independent_parameters_number)

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_numberNumber of independent_parameters_pointer.

Definition at line 851 of file neural_network.cpp.

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

Sets the neural network members by loading them from a XML file.

Parameters
file_nameNeural network XML file_name.

Definition at line 866 of file neural_network.cpp.

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

Sets the members of this neural network object with those from other neural network object.

Parameters
other_neural_networkNeural network object to be copied.

Definition at line 879 of file neural_network.cpp.

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

Sets a new bounding layer within the neural network.

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

Definition at line 1003 of file neural_network.cpp.

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

Sets a new conditions layer within the neural network.

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

Definition at line 1037 of file neural_network.cpp.

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

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

Sets new independent parameters within the neural network.

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

Definition at line 1088 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_inputs_pointer ( Inputs new_inputs_pointer)

Sets a new inputs object within the neural network.

Parameters
new_inputs_pointerPointer to an inputs object. Note that the neural network destructror will delete this pointer.

Definition at line 1054 of file neural_network.cpp.

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

Sets a new multilayer perceptron within the neural network.

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

Definition at line 952 of file neural_network.cpp.

void OpenNN::NeuralNetwork::set_outputs_pointer ( Outputs new_outputs_pointer)

Sets a new outputs object within the neural network.

Parameters
new_outputs_pointerPointer to an outputs object. Note that the neural network destructror will delete this pointer.

Definition at line 1071 of file neural_network.cpp.

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

Sets all the parameters (multilayer_perceptron_pointer parameters and independent parameters) from a single vector.

Parameters
new_parametersNew set of parameter values.

Definition at line 1320 of file neural_network.cpp.

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

Sets a new probabilistic layer within the neural network.

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

Definition at line 1020 of file neural_network.cpp.

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

Sets a new scaling layer within the neural network.

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

Definition at line 969 of file neural_network.cpp.

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

Sets a new unscaling layer within the neural network.

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

Definition at line 986 of file neural_network.cpp.

tinyxml2::XMLDocument * OpenNN::NeuralNetwork::to_XML ( void  ) const
virtual

Serializes the neural network object into a XML document of the TinyXML library. See the OpenNN manual for more information about the format of this element.

Definition at line 2770 of file neural_network.cpp.


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