#include <conditions_layer.h>
Public Types | |
enum | ConditionsMethod { OneCondition, TwoConditions, UserConditionsMethod } |
Public Member Functions | |
ConditionsLayer (void) | |
ConditionsLayer (const unsigned int &, const unsigned int &) | |
ConditionsLayer (TiXmlElement *) | |
ConditionsLayer (const ConditionsLayer &) | |
virtual | ~ConditionsLayer (void) |
ConditionsLayer & | operator= (const ConditionsLayer &) |
bool | operator== (const ConditionsLayer &) const |
const unsigned int & | get_external_inputs_number (void) const |
const unsigned int & | get_conditions_neurons_number (void) const |
const ConditionsMethod & | get_conditions_method (void) const |
std::string | write_conditions_method (void) const |
const Vector< double > & | get_external_input_values (void) const |
const double & | get_external_input_value (const unsigned int &) const |
const Matrix< double > & | get_output_values (void) const |
const double & | get_output_value (const unsigned int &, const unsigned int &) const |
const bool & | get_display (void) const |
void | set (void) |
void | set (const unsigned int &, const unsigned int &) |
void | set (const ConditionsLayer &) |
void | set_external_inputs_number (const unsigned int &) |
void | set_conditions_neurons_number (const unsigned int &) |
void | set_conditions_method (const ConditionsMethod &) |
void | set_conditions_method (const std::string &) |
void | set_external_input_values (const Vector< double > &) |
void | set_external_input_value (const unsigned int &, const double &) |
void | set_output_values (const Matrix< double > &) |
void | set_output_value (const unsigned int &, const unsigned int &, const double &) |
void | set_display (const bool &) |
void | set_default (void) |
void | initialize_random (void) |
void | check (void) const |
virtual Vector< double > | calculate_particular_solution (const Vector< double > &) const |
virtual Matrix< double > | calculate_particular_solution_Jacobian (const Vector< double > &) const |
virtual Vector< Matrix< double > > | calculate_particular_solution_Hessian_form (const Vector< double > &) const |
virtual Vector< double > | calculate_homogeneous_solution (const Vector< double > &) const |
virtual Matrix< double > | calculate_homogeneous_solution_Jacobian (const Vector< double > &) const |
virtual Vector< Matrix< double > > | calculate_homogeneous_solution_Hessian_form (const Vector< double > &) const |
Vector< double > | calculate_outputs (const Vector< double > &, const Vector< double > &) const |
Matrix< double > | calculate_Jacobian (const Vector< double > &, const Vector< double > &, const Matrix< double > &) const |
Vector< Matrix< double > > | calculate_Hessian_form (const Vector< double > &, const Vector< double > &) const |
Vector< double > | calculate_one_condition_particular_solution (const Vector< double > &) const |
Matrix< double > | calculate_one_condition_particular_solution_Jacobian (const Vector< double > &) const |
Vector< Matrix< double > > | calculate_one_condition_particular_solution_Hessian_form (const Vector< double > &) const |
Vector< double > | calculate_one_condition_homogeneous_solution (const Vector< double > &) const |
Matrix< double > | calculate_one_condition_homogeneous_solution_Jacobian (const Vector< double > &) const |
Vector< Matrix< double > > | calculate_one_condition_homogeneous_solution_Hessian_form (const Vector< double > &) const |
Vector< double > | calculate_two_conditions_particular_solution (const Vector< double > &) const |
Matrix< double > | calculate_two_conditions_particular_solution_Jacobian (const Vector< double > &) const |
Vector< Matrix< double > > | calculate_two_conditions_particular_solution_Hessian_form (const Vector< double > &) const |
Vector< double > | calculate_two_conditions_homogeneous_solution (const Vector< double > &) const |
Matrix< double > | calculate_two_conditions_homogeneous_solution_Jacobian (const Vector< double > &) const |
Vector< Matrix< double > > | calculate_two_conditions_homogeneous_solution_Hessian_form (const Vector< double > &) const |
virtual std::string | write_particular_solution_expression (const Vector< std::string > &, const Vector< std::string > &) const |
virtual std::string | write_homogeneous_solution_expression (const Vector< std::string > &, const Vector< std::string > &) const |
std::string | write_one_condition_particular_solution_expression (const Vector< std::string > &, const Vector< std::string > &) const |
std::string | write_one_condition_homogeneous_solution_expression (const Vector< std::string > &, const Vector< std::string > &) const |
std::string | write_two_conditions_particular_solution_expression (const Vector< std::string > &, const Vector< std::string > &) const |
std::string | write_two_conditions_homogeneous_solution_expression (const Vector< std::string > &, const Vector< std::string > &) const |
std::string | write_output_expression (const Vector< std::string > &, const Vector< std::string > &, const Vector< std::string > &, const Vector< std::string > &) const |
std::string | write_expression (const Vector< std::string > &, 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 | |
unsigned int | external_inputs_number |
unsigned int | conditions_neurons_number |
ConditionsMethod | conditions_method |
Vector< double > | external_input_values |
Matrix< double > | output_values |
bool | display |
Definition at line 39 of file conditions_layer.h.
Enumeration of available methods for applying conditions.
Definition at line 76 of file conditions_layer.h.
OpenNN::ConditionsLayer::ConditionsLayer | ( | void | ) | [explicit] |
Default constructor. It creates a conditions layer object.
Definition at line 41 of file conditions_layer.cpp.
OpenNN::ConditionsLayer::ConditionsLayer | ( | const unsigned int & | new_inputs_number, | |
const unsigned int & | new_conditions_neurons_number | |||
) | [explicit] |
Inputs and outputs number constructor.
new_inputs_number | Number of inputs. | |
new_conditions_neurons_number | Number of conditions neurons. |
Definition at line 55 of file conditions_layer.cpp.
OpenNN::ConditionsLayer::ConditionsLayer | ( | TiXmlElement * | conditions_layer_element | ) | [explicit] |
XML constructor.
conditions_layer_element | Pointer to a TinyXML element with the member data. |
Definition at line 68 of file conditions_layer.cpp.
OpenNN::ConditionsLayer::ConditionsLayer | ( | const ConditionsLayer & | other_conditions_layer | ) |
Copy constructor.
other_conditions_layer | Conditions layer object to be copied. |
Definition at line 81 of file conditions_layer.cpp.
OpenNN::ConditionsLayer::~ConditionsLayer | ( | void | ) | [virtual] |
ConditionsLayer & OpenNN::ConditionsLayer::operator= | ( | const ConditionsLayer & | other_conditions_layer | ) |
Assignment operator. It assigns to this object the members of an existing conditions layer object.
other_conditions_layer | Conditions layer object to be assigned. |
Definition at line 102 of file conditions_layer.cpp.
bool OpenNN::ConditionsLayer::operator== | ( | const ConditionsLayer & | other_conditions_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_conditions_layer Conditions layer to be compared with.
Definition at line 127 of file conditions_layer.cpp.
const unsigned int & OpenNN::ConditionsLayer::get_external_inputs_number | ( | void | ) | const |
This method returns the number of external inputs.
Definition at line 151 of file conditions_layer.cpp.
const unsigned int & OpenNN::ConditionsLayer::get_conditions_neurons_number | ( | void | ) | const |
This method returns the number of conditions neurons.
Definition at line 161 of file conditions_layer.cpp.
const ConditionsLayer::ConditionsMethod & OpenNN::ConditionsLayer::get_conditions_method | ( | void | ) | const |
This method returns the method for calculating the conditions. Avaliable methods include one conditions, two conditions or user defined conditions.
Definition at line 172 of file conditions_layer.cpp.
std::string OpenNN::ConditionsLayer::write_conditions_method | ( | void | ) | const |
This method returns a string with the name of the method for calculating the conditions. Avaliable methods include one conditions, two conditions or user defined conditions.
Definition at line 183 of file conditions_layer.cpp.
const Vector< double > & OpenNN::ConditionsLayer::get_external_input_values | ( | void | ) | const |
This method returns the input values for the conditions.
Definition at line 210 of file conditions_layer.cpp.
const double & OpenNN::ConditionsLayer::get_external_input_value | ( | const unsigned int & | i | ) | const |
This method returns a single input value for the conditions.
i | Index of condition. |
Definition at line 221 of file conditions_layer.cpp.
const Matrix< double > & OpenNN::ConditionsLayer::get_output_values | ( | void | ) | const |
This method returns the output values for the conditions.
Definition at line 231 of file conditions_layer.cpp.
const double & OpenNN::ConditionsLayer::get_output_value | ( | const unsigned int & | i, | |
const unsigned int & | j | |||
) | const |
This method returns a single output value for the conditions.
i | Index of output. | |
j | Index of condition. |
Definition at line 243 of file conditions_layer.cpp.
const bool & OpenNN::ConditionsLayer::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 254 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set | ( | void | ) |
This method sets a conditions layer object with zero inputs and zero outputs. It also sets the rest of members to their default values.
Definition at line 265 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set | ( | const unsigned int & | new_external_inputs_number, | |
const unsigned int & | new_conditions_neurons_number | |||
) |
This method sets the numbers of external inputs and conditions neurons. It also sets the rest of members to their default values.
Definition at line 280 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set | ( | const ConditionsLayer & | other_conditions_layer | ) |
This method sets the members of this conditions layer object with those from other conditions layer object.
other_conditions_layer | Conditions layer object to be copied. |
Definition at line 295 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set_external_inputs_number | ( | const unsigned int & | new_external_inputs_number | ) |
This method sets the number of external inputs in the conditions layer.
new_external_inputs_number | Number of external inputs. |
Definition at line 340 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set_conditions_neurons_number | ( | const unsigned int & | new_conditions_neurons_number | ) |
This method sets the number of conditions neurons in the layer.
new_conditions_neurons_number | Number of conditions neurons. |
Definition at line 351 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set_conditions_method | ( | const ConditionsMethod & | new_conditions_method | ) |
This method sets a new method for calculating the conditions.
new_conditions_method | Conditions method. |
Definition at line 362 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set_conditions_method | ( | const std::string & | new_conditions_method | ) |
This method sets a new conditions method from the string.
new_conditions_method | String with the name of the conditions method. |
Definition at line 373 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set_external_input_values | ( | const Vector< double > & | new_external_input_values | ) |
This method sets a new vector of external input values.
new_external_input_values | External input values. |
Definition at line 405 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set_external_input_value | ( | const unsigned int & | i, | |
const double & | new_external_input_value | |||
) |
This method sets a single external input value.
i | Index of external input value. | |
new_external_input_value | External input value. |
Definition at line 417 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set_output_values | ( | const Matrix< double > & | new_output_values | ) |
This method sets a new matrix of output values.
new_output_values | Output values. |
Definition at line 428 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set_output_value | ( | const unsigned int & | i, | |
const unsigned int & | j, | |||
const double & | new_output_value | |||
) |
This method sets a single output value.
i | Index of row. | |
j | Index of column. | |
new_output_value | Output value. |
Definition at line 441 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::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.
new_display | Display value. |
Definition at line 454 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::set_default | ( | void | ) |
This method sets the members of this conditions layer object to their default values.
Definition at line 314 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::initialize_random | ( | void | ) |
void OpenNN::ConditionsLayer::check | ( | void | ) | const |
This method checks that all the members of the conditions layer are correct before calculating the outputs from that layer.
Definition at line 474 of file conditions_layer.cpp.
Vector< double > OpenNN::ConditionsLayer::calculate_particular_solution | ( | const Vector< double > & | external_inputs | ) | const [virtual] |
This method returns the particular solution for applying boundary conditions.
This method returns the particular solution function for applying conditions.
external_inputs | Vector of external inputs. |
Definition at line 552 of file conditions_layer.cpp.
Matrix< double > OpenNN::ConditionsLayer::calculate_particular_solution_Jacobian | ( | const Vector< double > & | external_inputs | ) | const [virtual] |
This method returns the particular solution Jacobian for applying boundary conditions.
This method returns the particular solution Jacobian for applying conditions.
external_inputs | Vector of external inputs. |
Definition at line 588 of file conditions_layer.cpp.
Vector< Matrix< double > > OpenNN::ConditionsLayer::calculate_particular_solution_Hessian_form | ( | const Vector< double > & | external_inputs | ) | const [virtual] |
This method returns the Hessian form of the particular solution.
external_inputs | Vector of external inputs. |
Definition at line 624 of file conditions_layer.cpp.
Vector< double > OpenNN::ConditionsLayer::calculate_homogeneous_solution | ( | const Vector< double > & | external_inputs | ) | const [virtual] |
This method returns the homogeneous solution for applying boundary conditions.
This method returns the homogeneous solution values for applying conditions.
external_inputs | Vector of external inputs. |
Definition at line 660 of file conditions_layer.cpp.
Matrix< double > OpenNN::ConditionsLayer::calculate_homogeneous_solution_Jacobian | ( | const Vector< double > & | external_inputs | ) | const [virtual] |
This method returns the homogeneous solution Jacobian for applying boundary conditions.
This method returns the homogeneous solution Jacobian for applying conditions.
external_inputs | Vector of external inputs. |
Definition at line 696 of file conditions_layer.cpp.
Vector< Matrix< double > > OpenNN::ConditionsLayer::calculate_homogeneous_solution_Hessian_form | ( | const Vector< double > & | external_inputs | ) | const [virtual] |
This method returns the Hessian form of the homogeneous solution function.
external_inputs | Vector of external inputs. |
Definition at line 732 of file conditions_layer.cpp.
Vector< double > OpenNN::ConditionsLayer::calculate_outputs | ( | const Vector< double > & | external_inputs, | |
const Vector< double > & | inputs | |||
) | const |
This method returns the outputs satisfying the conditions defined by the particular and homogeneous solutions.
external_inputs | Vector of external inputs. | |
inputs | Vector of inputs to the conditons layer. |
Definition at line 769 of file conditions_layer.cpp.
Matrix< double > OpenNN::ConditionsLayer::calculate_Jacobian | ( | const Vector< double > & | external_inputs, | |
const Vector< double > & | outputs, | |||
const Matrix< double > & | Jacobian | |||
) | const |
This method calculates the partial derivatives of the outputs satisfying some boundary conditions with respect to the raw outputs.
external_inputs | Vector of external inputs. | |
outputs | Vector of outputs from the conditions layer. | |
Jacobian | Partial derivatives of the raw outputs with respect to the inputs. |
Definition at line 785 of file conditions_layer.cpp.
Vector< double > OpenNN::ConditionsLayer::calculate_one_condition_particular_solution | ( | const Vector< double > & | external_inputs | ) | const |
This method computes the particular solution for the one boundary condition case.
external_inputs | Vector of external inputs. |
Definition at line 813 of file conditions_layer.cpp.
Matrix< double > OpenNN::ConditionsLayer::calculate_one_condition_particular_solution_Jacobian | ( | const Vector< double > & | ) | const |
This method computes the Jacobian of the particular solution function for the one boundary condition case.
Definition at line 831 of file conditions_layer.cpp.
Vector< Matrix< double > > OpenNN::ConditionsLayer::calculate_one_condition_particular_solution_Hessian_form | ( | const Vector< double > & | ) | const |
This method computes the Hessian form of the particular solution function for the one boundary condition case.
Definition at line 850 of file conditions_layer.cpp.
Vector< double > OpenNN::ConditionsLayer::calculate_one_condition_homogeneous_solution | ( | const Vector< double > & | external_inputs | ) | const |
This method computes the homogeneous solution for the one boundary condition case.
external_inputs | Vector of external inputs. |
Definition at line 869 of file conditions_layer.cpp.
Matrix< double > OpenNN::ConditionsLayer::calculate_one_condition_homogeneous_solution_Jacobian | ( | const Vector< double > & | ) | const |
This method computes the homogeneous solution Jacobian for the one boundary condition case.
Definition at line 888 of file conditions_layer.cpp.
Vector< Matrix< double > > OpenNN::ConditionsLayer::calculate_one_condition_homogeneous_solution_Hessian_form | ( | const Vector< double > & | ) | const |
This method computes the homogeneous solution Hessian form for the one boundary condition case.
Definition at line 907 of file conditions_layer.cpp.
Vector< double > OpenNN::ConditionsLayer::calculate_two_conditions_particular_solution | ( | const Vector< double > & | external_inputs | ) | const |
This method computes the particular solution for the two boundary conditions case.
external_inputs | Vector of external inputs. |
Definition at line 926 of file conditions_layer.cpp.
Matrix< double > OpenNN::ConditionsLayer::calculate_two_conditions_particular_solution_Jacobian | ( | const Vector< double > & | ) | const |
This method computes the particular solution Jacobian for the two boundary conditions case.
Definition at line 976 of file conditions_layer.cpp.
Vector< Matrix< double > > OpenNN::ConditionsLayer::calculate_two_conditions_particular_solution_Hessian_form | ( | const Vector< double > & | ) | const |
This method computes the particular solution Hessian form for the two boundary conditions case.
Definition at line 1016 of file conditions_layer.cpp.
Vector< double > OpenNN::ConditionsLayer::calculate_two_conditions_homogeneous_solution | ( | const Vector< double > & | external_inputs | ) | const |
This method computes the homogeneous solution for the two boundary conditions case.
external_inputs | Vector of external inputs. |
Definition at line 1035 of file conditions_layer.cpp.
Matrix< double > OpenNN::ConditionsLayer::calculate_two_conditions_homogeneous_solution_Jacobian | ( | const Vector< double > & | external_inputs | ) | const |
This method computes the homogeneous solution Jacobian for the two boundary conditions case.
external_inputs | Vector of external inputs. |
Definition at line 1074 of file conditions_layer.cpp.
Vector< Matrix< double > > OpenNN::ConditionsLayer::calculate_two_conditions_homogeneous_solution_Hessian_form | ( | const Vector< double > & | ) | const |
This method computes the homogeneous solution Hessian form for the two boundary conditions case.
Definition at line 1113 of file conditions_layer.cpp.
std::string OpenNN::ConditionsLayer::write_particular_solution_expression | ( | const Vector< std::string > & | external_inputs_names, | |
const Vector< std::string > & | particular_solutions_names | |||
) | const [virtual] |
This method returns the expression of the particular solution function.
external_inputs_names | Names of external inputs. | |
particular_solutions_names | Names of particular solutions. |
Definition at line 1186 of file conditions_layer.cpp.
std::string OpenNN::ConditionsLayer::write_homogeneous_solution_expression | ( | const Vector< std::string > & | external_inputs_names, | |
const Vector< std::string > & | homogeneous_solutions_names | |||
) | const [virtual] |
This method returns the expression of the homogeneous solution function.
external_inputs_names | Names of external inputs. | |
homogeneous_solutions_names | Names of homogeneous solutions. |
Definition at line 1224 of file conditions_layer.cpp.
std::string OpenNN::ConditionsLayer::write_one_condition_particular_solution_expression | ( | const Vector< std::string > & | external_inputs_names, | |
const Vector< std::string > & | particular_solutions_names | |||
) | const |
external_inputs_names | Names of external inputs. | |
particular_solutions_names | Names of particular solutions. |
Definition at line 1261 of file conditions_layer.cpp.
std::string OpenNN::ConditionsLayer::write_one_condition_homogeneous_solution_expression | ( | const Vector< std::string > & | external_inputs_names, | |
const Vector< std::string > & | homogeneous_solutions_names | |||
) | const |
external_inputs_names | Names of external inputs. | |
homogeneous_solutions_names | Names of homogeneous solutions. |
Definition at line 1280 of file conditions_layer.cpp.
std::string OpenNN::ConditionsLayer::write_two_conditions_particular_solution_expression | ( | const Vector< std::string > & | external_inputs_names, | |
const Vector< std::string > & | particular_solutions_names | |||
) | const |
external_inputs_names | Names of external inputs. | |
particular_solutions_names | Names of particular solutions. |
Definition at line 1299 of file conditions_layer.cpp.
std::string OpenNN::ConditionsLayer::write_two_conditions_homogeneous_solution_expression | ( | const Vector< std::string > & | external_inputs_names, | |
const Vector< std::string > & | homogeneous_solutions_names | |||
) | const |
external_inputs_names | Names of external inputs. | |
homogeneous_solutions_names | Names of homogeneous solutions. |
Definition at line 1318 of file conditions_layer.cpp.
std::string OpenNN::ConditionsLayer::write_output_expression | ( | const Vector< std::string > & | particular_solutions_names, | |
const Vector< std::string > & | homogeneous_solutions_names, | |||
const Vector< std::string > & | inputs_names, | |||
const Vector< std::string > & | outputs_names | |||
) | const |
This method returns the mathematical expression of the function represented by the conditions layer.
particular_solutions_names | Names of particular solutions. | |
homogeneous_solutions_names | Names of homogeneous solutions. | |
inputs_names | Names of inputs. | |
outputs_names | Names of outputs. |
Definition at line 1339 of file conditions_layer.cpp.
std::string OpenNN::ConditionsLayer::write_expression | ( | const Vector< std::string > & | external_inputs_names, | |
const Vector< std::string > & | inputs_names, | |||
const Vector< std::string > & | outputs_names | |||
) | const |
This method returns a string with the expression of the boundary conditions function.
external_inputs_names | Names of external inputs. | |
inputs_names | Names of inputs. | |
outputs_names | Names of outputs. |
Definition at line 1135 of file conditions_layer.cpp.
std::string OpenNN::ConditionsLayer::to_string | ( | void | ) | const |
This method returns a string representation of the current conditions layer object.
Definition at line 1356 of file conditions_layer.cpp.
TiXmlElement * OpenNN::ConditionsLayer::to_XML | ( | void | ) | const |
This method serializes the conditions 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 1377 of file conditions_layer.cpp.
void OpenNN::ConditionsLayer::from_XML | ( | TiXmlElement * | conditions_layer_element | ) |
This method deserializes a TinyXML element into this conditions layer object.
conditions_layer_element | Pointer to a XML element containing the member data. |
Definition at line 1466 of file conditions_layer.cpp.
unsigned int OpenNN::ConditionsLayer::external_inputs_number [protected] |
Number of inputs to the conditions layer. This will be the number of inputs to the neural network.
Definition at line 195 of file conditions_layer.h.
unsigned int OpenNN::ConditionsLayer::conditions_neurons_number [protected] |
Number of conditions neurons. This will be the number of outputs from the neural network.
Definition at line 200 of file conditions_layer.h.
Vector<double> OpenNN::ConditionsLayer::external_input_values [protected] |
Matrix<double> OpenNN::ConditionsLayer::output_values [protected] |
bool OpenNN::ConditionsLayer::display [protected] |