#include <minkowski_error.h>
Public Member Functions | |
MinkowskiError (void) | |
MinkowskiError (NeuralNetwork *) | |
MinkowskiError (DataSet *) | |
MinkowskiError (NeuralNetwork *, DataSet *) | |
MinkowskiError (TiXmlElement *) | |
virtual | ~MinkowskiError (void) |
double | get_Minkowski_parameter (void) const |
void | set_default (void) |
void | set_Minkowski_parameter (const double &) |
void | check (void) const |
double | calculate_evaluation (void) const |
double | calculate_evaluation (const Vector< double > &) const |
double | calculate_generalization_evaluation (void) const |
Vector< double > | calculate_gradient (void) const |
Matrix< double > | calculate_Hessian (void) const |
std::string | write_performance_term_type (void) const |
TiXmlElement * | to_XML (void) const |
void | from_XML (TiXmlElement *) |
int | calculate_sign (const double &) const |
Definition at line 32 of file minkowski_error.h.
OpenNN::MinkowskiError::MinkowskiError | ( | void | ) | [explicit] |
Default constructor. It creates Minkowski error performance term not associated to any neural network and not measured on any data set. It also initializes all the rest of class members to their default values.
Definition at line 42 of file minkowski_error.cpp.
OpenNN::MinkowskiError::MinkowskiError | ( | NeuralNetwork * | new_neural_network_pointer | ) | [explicit] |
Neural network constructor. It creates a Minkowski error performance term associated to a neural network but not measured on any data set. 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 55 of file minkowski_error.cpp.
OpenNN::MinkowskiError::MinkowskiError | ( | DataSet * | new_data_set_pointer | ) | [explicit] |
Data set constructor. It creates a Minkowski error performance term not associated to any neural network but to be measured on a data set. It also initializes all the rest of class members to their default values.
new_data_set_pointer | Pointer to a data set object. |
Definition at line 69 of file minkowski_error.cpp.
OpenNN::MinkowskiError::MinkowskiError | ( | NeuralNetwork * | new_neural_network_pointer, | |
DataSet * | new_data_set_pointer | |||
) | [explicit] |
Neural network and data set constructor. It creates a Minkowski error performance term object associated to a neural network and measured on a data set. It also initializes all the rest of class members to their default values.
new_neural_network_pointer | Pointer to a neural network object. | |
new_data_set_pointer | Pointer to a data set object. |
Definition at line 84 of file minkowski_error.cpp.
OpenNN::MinkowskiError::MinkowskiError | ( | TiXmlElement * | mean_squared_error_element | ) | [explicit] |
XML constructor. It creates a Minkowski error object neither associated to a neural network nor to a data set. The object members are loaded by means of a XML element.
mean_squared_error_element | Tiny XML element with the Minkowski error elements. |
Definition at line 98 of file minkowski_error.cpp.
OpenNN::MinkowskiError::~MinkowskiError | ( | void | ) | [virtual] |
Destructor. It does not delete any pointer.
Definition at line 112 of file minkowski_error.cpp.
double OpenNN::MinkowskiError::get_Minkowski_parameter | ( | void | ) | const |
This method returns the Minkowski exponent value used to calculate the error.
Definition at line 123 of file minkowski_error.cpp.
void OpenNN::MinkowskiError::set_default | ( | void | ) | [virtual] |
This method sets the default values to a Minkowski error object:
Reimplemented from OpenNN::PerformanceTerm.
Definition at line 137 of file minkowski_error.cpp.
void OpenNN::MinkowskiError::set_Minkowski_parameter | ( | const double & | new_Minkowski_parameter | ) |
This method sets a new Minkowski exponent value to be used in order to calculate the error. The Minkowski R-value must be comprised between 1 and 2.
new_Minkowski_parameter | Minkowski exponent value. |
Definition at line 151 of file minkowski_error.cpp.
void OpenNN::MinkowskiError::check | ( | void | ) | const [virtual] |
This method checks that there are a neural network and a data set associated to the Minkowski error, and that the numbers of inputs and outputs in the neural network are equal to the numbers of inputs and targets in the data set. If some of the above conditions is not hold, the method throws an exception.
Reimplemented from OpenNN::PerformanceTerm.
Definition at line 178 of file minkowski_error.cpp.
double OpenNN::MinkowskiError::calculate_evaluation | ( | void | ) | const [virtual] |
This method returns the Minkowski error evaluation.
Implements OpenNN::PerformanceTerm.
Definition at line 313 of file minkowski_error.cpp.
double OpenNN::MinkowskiError::calculate_evaluation | ( | const Vector< double > & | parameters | ) | const [virtual] |
This method returns which would be the Minkowski error of for an hypothetical vector of parameters. It does not set that vector of parameters to the neural network.
parameters | Vector of a potential parameters for the neural network associated to the Minkowski error. |
Reimplemented from OpenNN::PerformanceTerm.
Definition at line 268 of file minkowski_error.cpp.
double OpenNN::MinkowskiError::calculate_generalization_evaluation | ( | void | ) | const [virtual] |
This method returns the Minkowski error of the multilayer perceptron measured on the generalization instances of the data set.
Reimplemented from OpenNN::PerformanceTerm.
Definition at line 369 of file minkowski_error.cpp.
Vector< double > OpenNN::MinkowskiError::calculate_gradient | ( | void | ) | const [virtual] |
This method returns the Minkowski error function gradient of a multilayer perceptron on an inputs-targets data set. It uses the error back-propagation method.
Reimplemented from OpenNN::PerformanceTerm.
Definition at line 423 of file minkowski_error.cpp.
Matrix< double > OpenNN::MinkowskiError::calculate_Hessian | ( | void | ) | const [virtual] |
std::string OpenNN::MinkowskiError::write_performance_term_type | ( | void | ) | const [virtual] |
This method returns a string with the name of the Minkowski error performance type, "MINKOWSKI_ERROR".
Reimplemented from OpenNN::PerformanceTerm.
Definition at line 492 of file minkowski_error.cpp.
TiXmlElement * OpenNN::MinkowskiError::to_XML | ( | void | ) | const [virtual] |
This method serializes the Minkowski error object into a XML element of the TinyXML library. See the OpenNN manual for more information about the format of this element.
Reimplemented from OpenNN::PerformanceTerm.
Definition at line 503 of file minkowski_error.cpp.
void OpenNN::MinkowskiError::from_XML | ( | TiXmlElement * | Minkoski_error_element | ) | [virtual] |
int OpenNN::MinkowskiError::calculate_sign | ( | const double & | value | ) | const |
This method returns -1 if some real value is negative and 1 if it is positive.
value | Real value. |
Definition at line 595 of file minkowski_error.cpp.