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
9#pragma once
10
11#include "inputs_selection.h"
12#include "neuron_selection.h"
13
14namespace opennn
15{
16
18
21{
22
23public:
24
25 // Constructors
26
29 const TrainingStrategy* get_training_strategy() const { return training_strategy; }
30 bool has_training_strategy() const { return training_strategy; }
31 void set(TrainingStrategy* new_training_strategy) { training_strategy = new_training_strategy; }
32
35
37 void check() const;
38
42
46
48 void from_JSON(const JsonDocument&);
49
51 void to_JSON(JsonWriter&) const;
52
54 void save(const filesystem::path&) const;
55
57 void load(const filesystem::path&);
58
59private:
60
61 NeuronSelection* get_neurons_selection() const { return neurons_selection.get(); }
62 InputsSelection* get_inputs_selection() const { return inputs_selection.get(); }
63 void set_neurons_selection(const string&);
64 void set_inputs_selection(const string&);
65
66 TrainingStrategy* training_strategy = nullptr;
67
68 unique_ptr<NeuronSelection> neurons_selection;
69
70 unique_ptr<InputsSelection> inputs_selection;
71};
72
73}
Abstract base class for algorithms that search the optimal subset of input variables.
Definition inputs_selection.h:23
Definition json.h:72
Definition json.h:85
void set(TrainingStrategy *new_training_strategy)
Definition model_selection.h:31
void load(const filesystem::path &)
Loads the model selection configuration from disk.
void save(const filesystem::path &) const
Saves the model selection configuration to disk.
NeuronsSelectionResults perform_neurons_selection()
Runs the configured neurons selection algorithm.
void from_JSON(const JsonDocument &)
Loads model selection configuration from a JSON document.
bool has_training_strategy() const
Definition model_selection.h:30
void check() const
Checks that the training strategy and its dependencies are consistent before running selection.
void set_default()
Restores default algorithms and parameters for inputs and neurons selection.
ModelSelection(TrainingStrategy *=nullptr)
Constructs a model selection bound to an optional training strategy.
const TrainingStrategy * get_training_strategy() const
Definition model_selection.h:29
InputsSelectionResults perform_input_selection()
Runs the configured inputs selection algorithm.
void to_JSON(JsonWriter &) const
Writes the current model selection configuration to a JSON writer.
Abstract base class for algorithms that select the optimal number of hidden neurons.
Definition neuron_selection.h:20
High-level orchestrator pairing a Loss with an Optimizer for a network/dataset.
Definition training_strategy.h:24
Definition adaptive_moment_estimation.h:14
Aggregated results of an inputs selection run including optimal inputs and error histories.
Definition inputs_selection.h:112
Aggregated results of a neurons selection run including the optimal neuron count and error histories.
Definition neuron_selection.h:111