minkowski_error.h
1// OpenNN: Open Neural Networks Library
2// www.opennn.net
3//
4// M I N K O W S K I E R R O R C L A S S H E A D E R
5//
6// Artificial Intelligence Techniques SL
7// artelnics@artelnics.com
8
9#ifndef MINKOWSKIERROR_H
10#define MINKOWSKIERROR_H
11
12// System includes
13
14#include <string>
15#include <sstream>
16#include <iostream>
17#include <fstream>
18#include <cmath>
19
20// OpenNN includes
21
22#include "config.h"
23#include "loss_index.h"
24#include "data_set.h"
25
26namespace OpenNN
27{
28
30
35
37{
38
39public:
40
41 // Constructors
42
43 explicit MinkowskiError();
44
46
47 // Destructor
48
49 virtual ~MinkowskiError();
50
51 // Get methods
52
53 type get_Minkowski_parameter() const;
54
55 // Set methods
56
57 void set_default();
58
59 void set_Minkowski_parameter(const type&);
60
61 // loss methods
62
63 void calculate_error(const DataSetBatch& batch,
64 const NeuralNetworkForwardPropagation& forward_propagation,
65 LossIndexBackPropagation& back_propagation) const;
66
67 void calculate_output_delta(const DataSetBatch&,
70
71 // Serialization methods
72
73 string get_error_type() const;
74 string get_error_type_text() const;
75
76 void from_XML(const tinyxml2::XMLDocument&);
77
79
80private:
81
83
85
86#ifdef OPENNN_CUDA
87 #include "../../opennn-cuda/opennn-cuda/minkowski_error_cuda.h"
88#endif
89
90};
91
92}
93
94#endif
95
96
97// OpenNN: Open Neural Networks Library.
98// Copyright(C) 2005-2021 Artificial Intelligence Techniques, SL.
99//
100// This library is free software; you can redistribute it and/or
101// modify it under the terms of the GNU Lesser General Public
102// License as published by the Free Software Foundation; either
103// version 2.1 of the License, or any later version.
104//
105// This library is distributed in the hope that it will be useful,
106// but WITHOUT ANY WARRANTY; without even the implied warranty of
107// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
108// Lesser General Public License for more details.
109
110// You should have received a copy of the GNU Lesser General Public
111// License along with this library; if not, write to the Free Software
112// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
This class represents the concept of data set for data modelling problems, such as approximation,...
Definition: data_set.h:57
This abstract class represents the concept of loss index composed of an error term and a regularizati...
Definition: loss_index.h:48
This class represents the Minkowski error term.
type minkowski_parameter
Minkowski exponent value.
void from_XML(const tinyxml2::XMLDocument &)
string get_error_type() const
Returns a string with the name of the Minkowski error loss type, "MINKOWSKI_ERROR".
void set_Minkowski_parameter(const type &)
type get_Minkowski_parameter() const
Returns the Minkowski exponent value used to calculate the error.
void write_XML(tinyxml2::XMLPrinter &) const
string get_error_type_text() const
Returns a string with the name of the Minkowski error loss type in text format.
void calculate_error(const DataSetBatch &batch, const NeuralNetworkForwardPropagation &forward_propagation, LossIndexBackPropagation &back_propagation) const
MinkowskiError::calculate_error.