sum_squared_error.h
1// OpenNN: Open Neural Networks Library
2// www.opennn.net
3//
4// S U M S Q U A R E D 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 SUMSQUAREDERROR_H
10#define SUMSQUAREDERROR_H
11
12// System includes
13
14#include <iostream>
15#include <fstream>
16#include <cmath>
17#include <sstream>
18#include <string>
19#include <limits>
20
21// OpenNN includes
22
23#include "config.h"
24
25#include "loss_index.h"
26#include "data_set.h"
27
28namespace OpenNN
29{
30
32
36
38{
39
40public:
41
42 // DEFAULT CONSTRUCTOR
43
44 explicit SumSquaredError();
45
47
48 virtual ~SumSquaredError();
49
50 // Back propagation
51
52 void calculate_error(const DataSetBatch&,
55
56 void calculate_output_delta(const DataSetBatch&,
59
60 // Back propagation LM
61
62 void calculate_error_lm(const DataSetBatch&,
65
66 void calculate_output_delta_lm(const DataSetBatch&,
69
70 void calculate_error_gradient_lm(const DataSetBatch&,
72
73 void calculate_error_hessian_lm(const DataSetBatch&,
75
76 // Serialization methods
77
78 string get_error_type() const;
79 string get_error_type_text() const;
80
82
84
85private:
86
87#ifdef OPENNN_CUDA
88 #include "../../opennn-cuda/opennn-cuda/sum_squared_error_cuda.h"
89#endif
90
91};
92
93}
94
95#endif
96
97
98// OpenNN: Open Neural Networks Library.
99// Copyright(C) 2005-2021 Artificial Intelligence Techniques, SL.
100//
101// This library is free software; you can redistribute it and/or
102// modify it under the terms of the GNU Lesser General Public
103// License as published by the Free Software Foundation; either
104// version 2.1 of the License, or any later version.
105//
106// This library is distributed in the hope that it will be useful,
107// but WITHOUT ANY WARRANTY; without even the implied warranty of
108// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
109// Lesser General Public License for more details.
110
111// You should have received a copy of the GNU Lesser General Public
112// License along with this library; if not, write to the Free Software
113// 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 sum squared peformance term functional.
virtual ~SumSquaredError()
Destructor.
void from_XML(const tinyxml2::XMLDocument &)
string get_error_type() const
Returns a string with the name of the sum squared error loss type, "SUM_SQUARED_ERROR".
void write_XML(tinyxml2::XMLPrinter &) const
string get_error_type_text() const
Returns a string with the name of the sum squared error loss type in text format.
A loss index composed of several terms, this structure represent the First Order for this function.
Definition: loss_index.h:383