pruning_inputs.h
1// OpenNN: Open Neural Networks Library
2// www.opennn.net
3//
4// P R U N I N G I N P U T S C L A S S H E A D E R
5//
6// Artificial Intelligence Techniques SL
7// artelnics@artelnics.com
8
9#ifndef PRUNINGINPUTS_H
10#define PRUNINGINPUTS_H
11
12// System includes
13
14#include <iostream>
15#include <fstream>
16#include <algorithm>
17#include <functional>
18#include <limits>
19#include <cmath>
20#include <ctime>
21
22// OpenNN includes
23
24#include "config.h"
25#include "training_strategy.h"
26#include "inputs_selection.h"
27
28
29namespace OpenNN
30{
31struct InputsSelectionResults;
32
34
36
38{
39public:
40 // DEFAULT CONSTRUCTOR
41
42 explicit PruningInputs();
43
44 // TRAINING STRATEGY CONSTRUCTOR
45
47
48 virtual ~PruningInputs();
49
50 // Get methods
51
52 const Index& get_minimum_inputs_number() const;
53
54 const Index& get_maximum_inputs_number() const;
55
56 const Index& get_maximum_selection_failures() const;
57
58 // Set methods
59
60 void set_default();
61
62 void set_minimum_inputs_number(const Index&);
63
64 void set_maximum_inputs_number(const Index&);
65
66 void set_maximum_selection_failures(const Index&);
67
68 // Order selection methods
69
71
72 // Serialization methods
73
74 Tensor<string, 2> to_string_matrix() const;
75
77
79
80 void save(const string&) const;
81 void load(const string&);
82
83private:
84
85 // Stopping criteria
86
88
90
92
94
96
98};
99
100}
101
102#endif
103
104// OpenNN: Open Neural Networks Library.
105// Copyright(C) 2005-2021 Artificial Intelligence Techniques, SL.
106//
107// This library is free software; you can redistribute it and/or
108// modify it under the terms of the GNU Lesser General Public
109// License as published by the Free Software Foundation; either
110// version 2.1 of the License, or any later version.
111//
112// This library is distributed in the hope that it will be useful,
113// but WITHOUT ANY WARRANTY; without even the implied warranty of
114// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
115// Lesser General Public License for more details.
116
117// You should have received a copy of the GNU Lesser General Public
118// License along with this library; if not, write to the Free Software
119// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
This abstract class represents the concept of inputs selection algorithm for a ModelSelection.
This concrete class represents a pruning inputs algorithm for the InputsSelection as part of the Mode...
void set_maximum_selection_failures(const Index &)
const Index & get_maximum_inputs_number() const
Returns the maximum number of inputs in the pruning inputs selection algorithm.
const Index & get_minimum_inputs_number() const
Returns the minimum number of inputs in the pruning inputs selection algorithm.
void from_XML(const tinyxml2::XMLDocument &)
void set_default()
Sets the members of the pruning inputs object to their default values.
void load(const string &)
PruningInputs()
Default constructor.
Tensor< string, 2 > to_string_matrix() const
Writes as matrix of strings the most representative atributes.
InputsSelectionResults perform_inputs_selection()
Perform the inputs selection with the pruning inputs method.
Index maximum_inputs_number
Maximum number of inputs in the neural network.
void set_maximum_inputs_number(const Index &)
void save(const string &) const
Index minimum_inputs_number
Minimum number of inputs in the neural network.
virtual ~PruningInputs()
Destructor.
void set_minimum_inputs_number(const Index &)
void write_XML(tinyxml2::XMLPrinter &) const
const Index & get_maximum_selection_failures() const
Returns the maximum number of selection failures in the pruning inputs algorithm.
Index maximum_selection_failures
Maximum number of epochs at which the selection error increases.
This class represents the concept of training strategy for a neural network in OpenNN.
This structure contains the results from the inputs selection.