Abstract base class for algorithms that select the optimal number of hidden neurons. More...
#include <neuron_selection.h>
Public Types | |
| enum class | StoppingCondition { MaximumTime , SelectionErrorGoal , MaximumEpochs , MaximumSelectionFailures , MaximumNeurons } |
| Reasons the neurons selection loop may terminate. More... | |
Public Member Functions | |
| NeuronSelection (TrainingStrategy *=nullptr) | |
| Constructs the algorithm bound to an optional training strategy. | |
| virtual | ~NeuronSelection ()=default |
| const TrainingStrategy * | get_training_strategy () const |
| bool | has_training_strategy () const |
| bool | get_display () const |
| void | set (TrainingStrategy *) |
| Binds the algorithm to the given training strategy. | |
| void | set_training_strategy (TrainingStrategy *new_training_strategy) |
| void | set_default () |
| Restores default search bounds and stopping criteria. | |
| void | set_maximum_neurons (const Index new_maximum_neurons) |
| void | set_minimum_neurons (const Index new_minimum_neurons) |
| void | set_trials_number (const Index new_trials_number) |
| void | set_display (bool new_display) |
| void | set_validation_error_goal (const float new_validation_error_goal) |
| void | set_maximum_epochs (const Index new_maximum_epochs) |
| void | set_maximum_validation_failures (const Index new_maximum_validation_failures) |
| void | set_maximum_time (const float new_maximum_time) |
| void | check () const |
| Verifies that the training strategy and its dependencies are valid for neurons selection. | |
| virtual NeuronsSelectionResults | perform_neurons_selection ()=0 |
| Runs the neurons selection algorithm until a stopping criterion is met. | |
| string | get_name () const |
| virtual void | from_JSON (const JsonDocument &)=0 |
| Loads algorithm configuration from a JSON document. | |
| virtual void | to_JSON (JsonWriter &) const =0 |
| Writes algorithm configuration to a JSON writer. | |
| void | save (const filesystem::path &) const |
| Saves the algorithm configuration to disk. | |
| void | load (const filesystem::path &) |
| Loads the algorithm configuration from disk. | |
| virtual void | print () const |
| Prints a human-readable description of the algorithm to stdout. | |
Protected Attributes | |
| TrainingStrategy * | training_strategy = nullptr |
| VectorR | validation_error_history |
| VectorR | training_error_history |
| Index | minimum_neurons = 0 |
| Index | maximum_neurons = 0 |
| Index | trials_number = 1 |
| float | validation_error_goal = 0 |
| Index | maximum_epochs = 10 |
| Index | maximum_validation_failures = 100 |
| float | maximum_time = 0 |
| bool | display = true |
| string | name |
Detailed Description
Abstract base class for algorithms that select the optimal number of hidden neurons.
Member Enumeration Documentation
◆ StoppingCondition
|
strong |
Constructor & Destructor Documentation
◆ NeuronSelection()
| opennn::NeuronSelection::NeuronSelection | ( | TrainingStrategy * | = nullptr | ) |
Constructs the algorithm bound to an optional training strategy.
◆ ~NeuronSelection()
|
virtualdefault |
Member Function Documentation
◆ check()
| void opennn::NeuronSelection::check | ( | ) | const |
Verifies that the training strategy and its dependencies are valid for neurons selection.
◆ from_JSON()
|
pure virtual |
Loads algorithm configuration from a JSON document.
Implemented in opennn::GrowingNeurons.
◆ get_display()
|
inline |
◆ get_name()
|
inline |
◆ get_training_strategy()
|
inline |
◆ has_training_strategy()
|
inline |
◆ load()
| void opennn::NeuronSelection::load | ( | const filesystem::path & | ) |
Loads the algorithm configuration from disk.
◆ perform_neurons_selection()
|
pure virtual |
Runs the neurons selection algorithm until a stopping criterion is met.
- Returns
- Results including the optimal neuron count, optimal parameters and error histories.
Implemented in opennn::GrowingNeurons.
◆ print()
|
inlinevirtual |
Prints a human-readable description of the algorithm to stdout.
◆ save()
| void opennn::NeuronSelection::save | ( | const filesystem::path & | ) | const |
Saves the algorithm configuration to disk.
◆ set()
| void opennn::NeuronSelection::set | ( | TrainingStrategy * | ) |
Binds the algorithm to the given training strategy.
◆ set_default()
| void opennn::NeuronSelection::set_default | ( | ) |
Restores default search bounds and stopping criteria.
◆ set_display()
|
inline |
◆ set_maximum_epochs()
|
inline |
◆ set_maximum_neurons()
|
inline |
◆ set_maximum_time()
|
inline |
◆ set_maximum_validation_failures()
|
inline |
◆ set_minimum_neurons()
|
inline |
◆ set_training_strategy()
|
inline |
◆ set_trials_number()
|
inline |
◆ set_validation_error_goal()
|
inline |
◆ to_JSON()
|
pure virtual |
Writes algorithm configuration to a JSON writer.
Implemented in opennn::GrowingNeurons.
Member Data Documentation
◆ display
|
protected |
◆ maximum_epochs
|
protected |
◆ maximum_neurons
|
protected |
◆ maximum_time
|
protected |
◆ maximum_validation_failures
|
protected |
◆ minimum_neurons
|
protected |
◆ name
|
protected |
◆ training_error_history
|
protected |
◆ training_strategy
|
protected |
◆ trials_number
|
protected |
◆ validation_error_goal
|
protected |
◆ validation_error_history
|
protected |