This class represents the normalized squared error term. More...
#include <normalized_squared_error.h>
Private Attributes | |
type | normalization_coefficient = type(NAN) |
Coefficient of normalization for the calculation of the training error. More... | |
type | selection_normalization_coefficient = type(NAN) |
Additional Inherited Members | |
![]() | |
enum class | RegularizationMethod { L1 , L2 , NoRegularization } |
Enumeration of available regularization methods. More... | |
![]() | |
NonBlockingThreadPool * | non_blocking_thread_pool = nullptr |
ThreadPoolDevice * | thread_pool_device = nullptr |
NeuralNetwork * | neural_network_pointer = nullptr |
Pointer to a neural network object. More... | |
DataSet * | data_set_pointer = nullptr |
Pointer to a data set object. More... | |
RegularizationMethod | regularization_method = RegularizationMethod::L2 |
Pointer to a regularization method object. More... | |
type | regularization_weight = static_cast<type>(0.01) |
Regularization weight value. More... | |
bool | display = true |
Display messages to screen. More... | |
const Eigen::array< IndexPair< Index >, 1 > | AT_B = {IndexPair<Index>(0, 0)} |
const Eigen::array< IndexPair< Index >, 1 > | A_B = {IndexPair<Index>(1, 0)} |
const Eigen::array< IndexPair< Index >, 2 > | SSE = {IndexPair<Index>(0, 0), IndexPair<Index>(1, 1)} |
const Eigen::array< int, 1 > | rows_sum = {Eigen::array<int, 1>({1})} |
This class represents the normalized squared error term.
This error term is used in data modeling problems. If it has a value of unity then the neural network is predicting the data "in the mean", A value of zero means perfect prediction of data.
Definition at line 37 of file normalized_squared_error.h.
|
explicit |
Neural network and data set constructor. It creates a normalized squared error term 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 31 of file normalized_squared_error.cpp.
|
explicit |
Default constructor. It creates a normalized squared error term object 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 19 of file normalized_squared_error.cpp.
|
virtual |
Destructor.
Definition at line 40 of file normalized_squared_error.cpp.
|
virtual |
NormalizedSquaredError::calculate_error.
batch | |
forward_propagation | |
back_propagation |
Implements LossIndex.
Definition at line 282 of file normalized_squared_error.cpp.
|
virtual |
Reimplemented from LossIndex.
Definition at line 465 of file normalized_squared_error.cpp.
|
virtual |
Reimplemented from LossIndex.
Definition at line 480 of file normalized_squared_error.cpp.
|
virtual |
Reimplemented from LossIndex.
Definition at line 314 of file normalized_squared_error.cpp.
type calculate_normalization_coefficient | ( | const Tensor< type, 2 > & | targets, |
const Tensor< type, 1 > & | targets_mean | ||
) | const |
Returns the normalization coefficient to be used for the loss of the error. This is measured on the training samples of the data set.
targets | Matrix with the targets values from data_set. |
targets_mean | Vector with the means of the given targets. |
Definition at line 238 of file normalized_squared_error.cpp.
|
virtual |
Implements LossIndex.
Definition at line 345 of file normalized_squared_error.cpp.
|
virtual |
Reimplemented from LossIndex.
Definition at line 410 of file normalized_squared_error.cpp.
type calculate_time_series_normalization_coefficient | ( | const Tensor< type, 2 > & | targets_t_1, |
const Tensor< type, 2 > & | targets_t | ||
) | const |
Definition at line 133 of file normalized_squared_error.cpp.
void from_XML | ( | const tinyxml2::XMLDocument & | document | ) |
Loads a root mean squared error object from a XML document.
document | Pointer to a TinyXML document with the object data. |
Definition at line 533 of file normalized_squared_error.cpp.
|
virtual |
Returns a string with the name of the normalized squared error loss type, "NORMALIZED_SQUARED_ERROR".
Reimplemented from LossIndex.
Definition at line 503 of file normalized_squared_error.cpp.
|
virtual |
Returns a string with the name of the normalized squared error loss type in text format.
Reimplemented from LossIndex.
Definition at line 511 of file normalized_squared_error.cpp.
type get_normalization_coefficient | ( | ) | const |
Returns the normalization coefficient.
Definition at line 47 of file normalized_squared_error.cpp.
type get_selection_normalization_coefficient | ( | ) | const |
Returns the selection normalization coefficient.
Definition at line 55 of file normalized_squared_error.cpp.
|
virtual |
set_data_set_pointer
new_data_set_pointer |
Reimplemented from LossIndex.
Definition at line 65 of file normalized_squared_error.cpp.
void set_default | ( | ) |
Sets the default values.
Definition at line 218 of file normalized_squared_error.cpp.
|
virtual |
Sets the normalization coefficient from training samples. This method calculates the normalization coefficient of the data_set.
Reimplemented from LossIndex.
Definition at line 83 of file normalized_squared_error.cpp.
void set_normalization_coefficient | ( | const type & | new_normalization_coefficient | ) |
Sets the normalization coefficient.
new_normalization_coefficient | New normalization coefficient to be set. |
Definition at line 178 of file normalized_squared_error.cpp.
void set_selection_normalization_coefficient | ( | ) |
Sets the normalization coefficient from selection samples. This method calculates the normalization coefficient of the data_set.
Definition at line 187 of file normalized_squared_error.cpp.
void set_selection_normalization_coefficient | ( | const type & | new_selection_normalization_coefficient | ) |
Sets the normalization coefficient from selection samples.
new_normalization_coefficient | New normalization coefficient to be set. |
Definition at line 210 of file normalized_squared_error.cpp.
void set_time_series_normalization_coefficient | ( | ) |
Definition at line 101 of file normalized_squared_error.cpp.
|
virtual |
Serializes the cross entropy error object into a XML document of the TinyXML library without keep the DOM tree in memory. See the OpenNN manual for more information about the format of this document
Reimplemented from LossIndex.
Definition at line 520 of file normalized_squared_error.cpp.
|
private |
Coefficient of normalization for the calculation of the training error.
Definition at line 116 of file normalized_squared_error.h.
|
private |
Definition at line 118 of file normalized_squared_error.h.