OpenNN
2.2
Open Neural Networks Library
|
#include <solutions_error.h>
Public Types | |
enum | SolutionsErrorMethod { SolutionsErrorSum, SolutionsErrorIntegral } |
Protected Attributes | |
NumericalIntegration | numerical_integration |
SolutionsErrorMethod | solutions_error_method |
Vector< double > | solutions_errors_weights |
Protected Attributes inherited from OpenNN::PerformanceTerm | |
NeuralNetwork * | neural_network_pointer |
DataSet * | data_set_pointer |
MathematicalModel * | mathematical_model_pointer |
NumericalDifferentiation * | numerical_differentiation_pointer |
bool | display |
This class implements a performance term called solutions error. This performance term is measured on a mathematical model. It computes the difference between the solution from a mathematical model and a given target solution. This type of functional is very used in optimal control problems, in which the neural network represents the control variables. The first and second derivatives of this type of performance term are calculated with numerical differentiation.
Definition at line 45 of file solutions_error.h.
|
explicit |
Default constructor. It creates a solutions error performance term not associated to any neural network and not measured on any mathematical model. It also initializes all the rest of class members to their default values.
Definition at line 28 of file solutions_error.cpp.
|
explicit |
Neural network constructor. It creates a solutions error associated to a neural network, but not to a . It also initializes all the rest of class members to their default values.
new_neural_network_pointer | Pointer to a neural network object. |
Definition at line 43 of file solutions_error.cpp.
|
explicit |
Mathematical model constructor. It creates solutions error object not associated to any neural network but to be measured on a given mathematical model object. It also initializes all the rest of class members to their default values.
new_mathematical_model_pointer | Pointer to a mathematical model object. |
Definition at line 59 of file solutions_error.cpp.
|
explicit |
Neural network and mathematical model constructor. It creates a solutions error functional associated to a neural network and measured on a mathematical model. It also initializes all the rest of class members to their default values.
new_neural_network_pointer | Pointer to a neural network object. |
new_mathematical_model_pointer | Pointer to a mathematical model object. |
Definition at line 76 of file solutions_error.cpp.
|
explicit |
xml constructor. It creates a solutions error performance term not associated to any neural network and not measured on any mathematical model. It also initializes all the rest of class members with values taken from a TinyXML document->
solutions_error_document | XML document containing the class members. |
Definition at line 92 of file solutions_error.cpp.
OpenNN::SolutionsError::SolutionsError | ( | const SolutionsError & | other_solutions_error | ) |
Copy constructor. It creates a copy of an existing solutions error object.
other_solutions_error | Solutions error object to be copied. |
Definition at line 107 of file solutions_error.cpp.
|
virtual |
Destructor. This destructor does not delete any object. The numerical differentiation object is deleted by the performance term destructor.
Definition at line 138 of file solutions_error.cpp.
|
virtual |
Calculates the solutions error value of the neural network for a given set of parameters.
parameters | Vector of potential neural network parameters. |
Implements OpenNN::PerformanceTerm.
Definition at line 583 of file solutions_error.cpp.
double OpenNN::SolutionsError::calculate_solutions_error_integral | ( | void | ) | const |
Definition at line 529 of file solutions_error.cpp.
double OpenNN::SolutionsError::calculate_solutions_error_sum | ( | void | ) | const |
Calculates the solutions error performance as the weighted mean squared error between the solutions to the mathematical model and the target solutions.
Definition at line 481 of file solutions_error.cpp.
|
virtual |
Checks that:
If some of the conditions above is not hold, an exception is thrown.
Reimplemented from OpenNN::PerformanceTerm.
Definition at line 401 of file solutions_error.cpp.
|
virtual |
Loads a solutions error object from a XML document.
document | TinyXML document with the members of the solutions error object. |
Reimplemented from OpenNN::PerformanceTerm.
Definition at line 718 of file solutions_error.cpp.
SolutionsError & OpenNN::SolutionsError::operator= | ( | const SolutionsError & | other_solutions_error | ) |
Assignment operator. It assigns to this solutions error object the members from another solutions error object.
other_solutions_error | Solutions error object to be copied. |
Definition at line 151 of file solutions_error.cpp.
bool OpenNN::SolutionsError::operator== | ( | const SolutionsError & | other_solutions_error | ) | const |
Equal to operator. It compares this object to another object, and returns true if both have the same member data, and false otherwise.
Definition at line 176 of file solutions_error.cpp.
|
virtual |
Sets the default values for an object of the solutions error class:
Reimplemented from OpenNN::PerformanceTerm.
Definition at line 347 of file solutions_error.cpp.
void OpenNN::SolutionsError::set_solution_error_weight | ( | const size_t & | i, |
const double & | new_solution_error_weight | ||
) |
Sets a new weight for the solution error of a single dependent variable.
i | Index of dependent variable. |
new_solution_error_weight | Weight for the error between the above dependent variable solution and the corresponding target solution. |
Definition at line 332 of file solutions_error.cpp.
void OpenNN::SolutionsError::set_solutions_error_method | ( | const SolutionsErrorMethod & | new_solutions_error_method | ) |
Sets a new method for calculating the error between the solution of a mathematical model and a target solution.
new_solutions_error_method | Method for evaluating this performance term. |
Definition at line 281 of file solutions_error.cpp.
void OpenNN::SolutionsError::set_solutions_error_method | ( | const std::string & | new_solutions_error_method | ) |
Sets a new solutions error method from a string with that method's name.
new_solutions_error_method | String with the name of the method. |
Definition at line 292 of file solutions_error.cpp.
void OpenNN::SolutionsError::set_solutions_errors_weights | ( | const Vector< double > & | new_solutions_errors_weights | ) |
Sets new weights for the solution error of every dependent variable.
new_solutions_errors_weights | Weights for the errors between the dependent variable solutions and the corresponding target solutions. |
Definition at line 320 of file solutions_error.cpp.
|
virtual |
Returns a string with the default information of the performance term. It will be used by the training strategy to monitor the training process. By default this information is empty.
Reimplemented from OpenNN::PerformanceTerm.
Definition at line 618 of file solutions_error.cpp.