OpenNN
Open-source neural networks library
Loading...
Searching...
No Matches
model_selection.h
Go to the documentation of this file.
1// OpenNN: Open Neural Networks Library
2// www.opennn.net
3//
4// M O D E L S E L E C T I O N C L A S S H E A D E R
5//
6// Artificial Intelligence Techniques SL
7// artelnics@artelnics.com
8
16
17#pragma once
18
19#include "inputs_selection.h"
20#include "neuron_selection.h"
21
22namespace opennn
23{
24
26
40{
41
42public:
43
44 // Constructors
45
55 ModelSelection(TrainingStrategy* new_training_strategy = nullptr);
56
61 const TrainingStrategy* get_training_strategy() const { return training_strategy; }
62
67 bool has_training_strategy() const { return training_strategy; }
68
73 void set(TrainingStrategy* new_training_strategy) { training_strategy = new_training_strategy; }
74
82
91 void check() const;
92
98
104
109 void from_JSON(const JsonDocument& document);
110
115 void to_JSON(JsonWriter& writer) const;
116
122 void save(const filesystem::path& file_name) const;
123
128 void load(const filesystem::path& file_name);
129
130private:
131
136 NeuronSelection* get_neurons_selection() const { return neurons_selection.get(); }
137
142 InputsSelection* get_inputs_selection() const { return inputs_selection.get(); }
143
152 void set_neurons_selection(const string& new_neurons_selection);
153
163 void set_inputs_selection(const string& new_inputs_selection);
164
166 TrainingStrategy* training_strategy = nullptr;
167
169 unique_ptr<NeuronSelection> neurons_selection;
170
172 unique_ptr<InputsSelection> inputs_selection;
173};
174
175}
Abstract base class for input feature selection methods.
Definition inputs_selection.h:41
Definition json.h:71
Definition json.h:84
void set(TrainingStrategy *new_training_strategy)
Replaces the underlying training strategy.
Definition model_selection.h:73
NeuronsSelectionResults perform_neurons_selection()
Runs the configured neuron-selection algorithm.
bool has_training_strategy() const
Reports whether a training strategy is configured.
Definition model_selection.h:67
ModelSelection(TrainingStrategy *new_training_strategy=nullptr)
Constructs a model selection bound to a training strategy.
void save(const filesystem::path &file_name) const
Saves the model-selection state to a JSON file on disk.
void check() const
Validates that all components needed for selection are set.
void set_default()
Picks default selection algorithms.
void load(const filesystem::path &file_name)
Loads the model-selection state from a JSON file on disk.
const TrainingStrategy * get_training_strategy() const
Returns the underlying training strategy.
Definition model_selection.h:61
InputsSelectionResults perform_input_selection()
Runs the configured input-selection algorithm.
void from_JSON(const JsonDocument &document)
Restores the model-selection state from a JSON document.
void to_JSON(JsonWriter &writer) const
Serializes the model-selection state to JSON.
Abstract base class for hidden-layer-size selection methods.
Definition neuron_selection.h:37
Coordinates the training of a NeuralNetwork on a Dataset.
Definition training_strategy.h:45
Declares the InputsSelection abstract base and the InputsSelectionResults summary structure.
Definition adaptive_moment_estimation.h:19
Declares the NeuronSelection abstract base and the NeuronsSelectionResults summary structure.
Outcome of an InputsSelection run.
Definition inputs_selection.h:196
Outcome of a NeuronSelection run.
Definition neuron_selection.h:219