14 #ifndef __NEURALNETWORK_H__
15 #define __NEURALNETWORK_H__
33 #include "perceptron.h"
34 #include "perceptron_layer.h"
35 #include "multilayer_perceptron.h"
36 #include "scaling_layer.h"
37 #include "unscaling_layer.h"
38 #include "bounding_layer.h"
39 #include "probabilistic_layer.h"
40 #include "conditions_layer.h"
41 #include "independent_parameters.h"
47 #include "../tinyxml2/tinyxml2.h"
80 explicit NeuralNetwork(
const size_t&,
const size_t&,
const size_t&);
153 void set(
const size_t&,
const size_t&);
154 void set(
const size_t&,
const size_t&,
const size_t&);
157 void set(
const size_t&);
159 void set(
const std::string&);
269 virtual tinyxml2::XMLDocument*
to_XML(
void)
const;
270 virtual void from_XML(
const tinyxml2::XMLDocument&);
272 void print(
void)
const;
273 void save(
const std::string&)
const;
276 virtual void load(
const std::string&);
279 void save_data(
const std::string&)
const;
void load_parameters(const std::string &)
bool has_independent_parameters(void) const
size_t count_parameters_number(void) const
bool has_inputs(void) const
Outputs * get_outputs_pointer(void) const
Returns a pointer to the outputs object composing this neural network.
void construct_scaling_layer(void)
size_t get_layers_number(void)
ScalingLayer * get_scaling_layer_pointer(void) const
Returns a pointer to the scaling layer composing this neural network.
bool display
Display messages to screen.
size_t get_inputs_number(void) const
Returns the number of inputs to the neural network.
void destruct_independent_parameters(void)
This method deletes the independent parameters object within the neural network.
bool has_outputs(void) const
Vector< double > arrange_parameters(void) const
std::string write_expression(void) const
Returns a string with the expression of the function represented by the neural network.
Vector< Matrix< double > > calculate_Hessian_form(const Vector< double > &) const
void construct_outputs(void)
void set_outputs_pointer(Outputs *)
BoundingLayer * bounding_layer_pointer
Pointer to a bounding layer object.
double calculate_parameters_norm(void) const
Returns the norm of the vector of parameters.
Vector< double > calculate_outputs(const Vector< double > &) const
IndependentParameters * independent_parameters_pointer
Pointer to an independent parameters object.
ScalingLayer * scaling_layer_pointer
Pointer to a scaling layer object.
void construct_bounding_layer(void)
NeuralNetwork & operator=(const NeuralNetwork &)
virtual void set_default(void)
Sets those members which are not pointer to their default values.
void set_scaling_layer_pointer(ScalingLayer *)
Matrix< double > calculate_directional_input_data(const size_t &, const Vector< double > &, const double &, const double &, const size_t &=101) const
void prune_output(const size_t &)
void destruct_scaling_layer(void)
This method deletes the scaling layer within the neural network.
void initialize_parameters(const double &)
Initializes all the neural and the independent parameters with a given value.
void set_independent_parameters_pointer(IndependentParameters *)
void destruct_inputs(void)
This method deletes the inputs object within the neural network.
void randomize_parameters_uniform(void)
ProbabilisticLayer * get_probabilistic_layer_pointer(void) const
Returns a pointer to the probabilistic layer composing this neural network.
void destruct_conditions_layer(void)
This method deletes the conditions layer within the neural network.
void destruct_multilayer_perceptron(void)
This method deletes the multilayer perceptron within the neural network.
ConditionsLayer * conditions_layer_pointer
Pointer to a conditions object.
ProbabilisticLayer * probabilistic_layer_pointer
Pointer to a probabilistic layer.
Statistics< double > calculate_parameters_statistics(void) const
void print(void) const
Prints to the screen the members of a neural network object in a XML-type format. ...
void construct_conditions_layer(void)
Inputs * get_inputs_pointer(void) const
Returns a pointer to the inputs object composing this neural network.
void set_probabilistic_layer_pointer(ProbabilisticLayer *)
bool has_conditions_layer(void) const
void save_parameters(const std::string &) const
virtual void from_XML(const tinyxml2::XMLDocument &)
void destruct_probabilistic_layer(void)
This method deletes the probabilistic layer within the neural network.
MultilayerPerceptron * get_multilayer_perceptron_pointer(void) const
Returns a pointer to the multilayer perceptron composing this neural network.
void prune_input(const size_t &)
void construct_inputs(void)
bool has_unscaling_layer(void) const
void initialize_random(void)
UnscalingLayer * unscaling_layer_pointer
Pointer to an unscaling layer object.
Matrix< double > calculate_output_data(const Matrix< double > &) const
Outputs * outputs_pointer
Pointer to an outputs object.
void save_data(const std::string &) const
void set_multilayer_perceptron_pointer(MultilayerPerceptron *)
virtual tinyxml2::XMLDocument * to_XML(void) const
size_t get_outputs_number(void) const
Returns the number of outputs to the neural network.
Vector< Matrix< double > > calculate_Jacobian_data(const Matrix< double > &) const
Matrix< double > calculate_Jacobian(const Vector< double > &) const
void delete_pointers(void)
void resize_inputs_number(const size_t &)
void construct_independent_parameters(void)
UnscalingLayer * get_unscaling_layer_pointer(void) const
Returns a pointer to the unscaling layer composing this neural network.
void set_unscaling_layer_pointer(UnscalingLayer *)
void construct_multilayer_perceptron(void)
This method constructs an empty multilayer perceptron within the neural network.
BoundingLayer * get_bounding_layer_pointer(void) const
Returns a pointer to the bounding layer composing this neural network.
ConditionsLayer * get_conditions_layer_pointer(void) const
Returns a pointer to the conditions layer composing this neural network.
IndependentParameters * get_independent_parameters_pointer(void) const
Returns a pointer to the independent parameters object composing this neural network.
void save(const std::string &) const
void randomize_parameters_normal(void)
void destruct_bounding_layer(void)
This method deletes the bounding layer within the neural network.
std::string to_string(void) const
Returns a string representation of the current neural network object.
void set_bounding_layer_pointer(BoundingLayer *)
void set_inputs_pointer(Inputs *)
void construct_probabilistic_layer(void)
MultilayerPerceptron * multilayer_perceptron_pointer
Pointer to a multilayer perceptron object.
Inputs * inputs_pointer
Pointer to an inputs object.
bool has_probabilistic_layer(void) const
Vector< size_t > arrange_architecture(void) const
virtual ~NeuralNetwork(void)
Destructor.
const bool & get_display(void) const
void set_conditions_layer_pointer(ConditionsLayer *)
void destruct_outputs(void)
This method deletes the outputs object within the neural network.
void save_expression(const std::string &)
bool has_multilayer_perceptron(void) const
void resize_outputs_number(const size_t &)
void set_display(const bool &)
void destruct_unscaling_layer(void)
This method deletes the unscaling layer within the neural network.
virtual void load(const std::string &)
bool has_bounding_layer(void) const
void construct_unscaling_layer(void)
bool operator==(const NeuralNetwork &) const
bool has_scaling_layer(void) const
void set_parameters(const Vector< double > &)
Histogram< double > calculate_parameters_histogram(const size_t &=10) const