This abstract class represents the concept of neurons selection algorithm for a ModelSelection[1]. More...
#include <neurons_selection.h>
Public Types | |
enum class | StoppingCondition { MaximumTime , SelectionErrorGoal , MaximumEpochs , MaximumSelectionFailures , MaximumNeurons } |
Enumeration of all possibles condition of stop for the algorithms. More... | |
Public Member Functions | |
NeuronsSelection () | |
Default constructor. More... | |
NeuronsSelection (TrainingStrategy *) | |
virtual | ~NeuronsSelection () |
Destructor. More... | |
TrainingStrategy * | get_training_strategy_pointer () const |
Returns a pointer to the training strategy object. More... | |
bool | has_training_strategy () const |
Returns true if this neurons selection algorithm has a training strategy associated, and false otherwise. More... | |
const Index & | get_maximum_neurons () const |
Returns the maximum of the hidden perceptrons number used in the neurons selection. More... | |
const Index & | get_minimum_neurons () const |
Returns the minimum of the hidden perceptrons number used in the neurons selection. More... | |
const Index & | get_trials_number () const |
Returns the number of trials for each network architecture. More... | |
const bool & | get_display () const |
const type & | get_selection_error_goal () const |
Returns the goal for the selection error in the neurons selection algorithm. More... | |
const Index & | get_maximum_epochs_number () const |
Returns the maximum number of epochs in the neurons selection algorithm. More... | |
const type & | get_maximum_time () const |
Returns the maximum time in the neurons selection algorithm. More... | |
void | set_training_strategy_pointer (TrainingStrategy *) |
void | set_default () |
Sets the members of the neurons selection object to their default values. More... | |
void | set_maximum_neurons_number (const Index &) |
void | set_minimum_neurons (const Index &) |
void | set_trials_number (const Index &) |
void | set_display (const bool &) |
void | set_selection_error_goal (const type &) |
void | set_maximum_epochs_number (const Index &) |
void | set_maximum_time (const type &) |
string | write_stopping_condition (const TrainingResults &) const |
void | delete_selection_history () |
Delete the history of the selection error values. More... | |
void | delete_training_error_history () |
Delete the history of the loss values. More... | |
void | check () const |
Checks that the different pointers needed for performing the neurons selection are not nullptr. More... | |
virtual NeuronsSelectionResults | perform_neurons_selection ()=0 |
Performs the neurons selection for a neural network. More... | |
const string | write_time (const type &) const |
Writes the time from seconds in format HH:mm:ss. More... | |
Protected Attributes | |
TrainingStrategy * | training_strategy_pointer = nullptr |
Pointer to a training strategy object. More... | |
Tensor< Index, 1 > | neurons_history |
Neurons of all the neural networks trained. More... | |
Tensor< type, 1 > | selection_error_history |
Selection loss of all the neural networks trained. More... | |
Tensor< type, 1 > | training_error_history |
Error of all the neural networks trained. More... | |
Index | minimum_neurons |
Minimum number of hidden neurons. More... | |
Index | maximum_neurons |
Maximum number of hidden neurons. More... | |
Index | trials_number = 1 |
Number of trials for each neural network. More... | |
bool | display = true |
Display messages to screen. More... | |
type | selection_error_goal |
Goal value for the selection error. It is used as a stopping criterion. More... | |
Index | maximum_epochs_number |
Maximum number of epochs to perform neurons selection. It is used as a stopping criterion. More... | |
type | maximum_time |
Maximum selection algorithm time. It is used as a stopping criterion. More... | |
This abstract class represents the concept of neurons selection algorithm for a ModelSelection[1].
Any derived class must implement the perform_neurons_selection() method.
[1] Neural Designer "Model Selection Algorithms in Predictive Analytics." https://www.neuraldesigner.com/blog/model-selection
Definition at line 38 of file neurons_selection.h.
|
strong |
Enumeration of all possibles condition of stop for the algorithms.
Definition at line 56 of file neurons_selection.h.
|
explicit |
Default constructor.
Definition at line 16 of file neurons_selection.cpp.
|
explicit |
Training strategy constructor.
new_training_strategy_pointer | Pointer to a training strategy object. |
Definition at line 27 of file neurons_selection.cpp.
|
virtual |
Destructor.
Definition at line 37 of file neurons_selection.cpp.
void check | ( | ) | const |
Checks that the different pointers needed for performing the neurons selection are not nullptr.
Definition at line 386 of file neurons_selection.cpp.
void delete_selection_history | ( | ) |
Delete the history of the selection error values.
Definition at line 370 of file neurons_selection.cpp.
void delete_training_error_history | ( | ) |
Delete the history of the loss values.
Definition at line 378 of file neurons_selection.cpp.
const bool & get_display | ( | ) | const |
Returns true if messages from this class can be displayed on the screen, or false if messages from this class can't be displayed on the screen.
Definition at line 107 of file neurons_selection.cpp.
const Index & get_maximum_epochs_number | ( | ) | const |
Returns the maximum number of epochs in the neurons selection algorithm.
Definition at line 123 of file neurons_selection.cpp.
const Index & get_maximum_neurons | ( | ) | const |
Returns the maximum of the hidden perceptrons number used in the neurons selection.
Definition at line 82 of file neurons_selection.cpp.
const type & get_maximum_time | ( | ) | const |
Returns the maximum time in the neurons selection algorithm.
Definition at line 131 of file neurons_selection.cpp.
const Index & get_minimum_neurons | ( | ) | const |
Returns the minimum of the hidden perceptrons number used in the neurons selection.
Definition at line 90 of file neurons_selection.cpp.
const type & get_selection_error_goal | ( | ) | const |
Returns the goal for the selection error in the neurons selection algorithm.
Definition at line 115 of file neurons_selection.cpp.
TrainingStrategy * get_training_strategy_pointer | ( | ) | const |
Returns a pointer to the training strategy object.
Definition at line 44 of file neurons_selection.cpp.
const Index & get_trials_number | ( | ) | const |
Returns the number of trials for each network architecture.
Definition at line 98 of file neurons_selection.cpp.
bool has_training_strategy | ( | ) | const |
Returns true if this neurons selection algorithm has a training strategy associated, and false otherwise.
Definition at line 67 of file neurons_selection.cpp.
|
pure virtual |
Performs the neurons selection for a neural network.
Implemented in GrowingNeurons.
void set_default | ( | ) |
Sets the members of the neurons selection object to their default values.
Definition at line 148 of file neurons_selection.cpp.
void set_display | ( | const bool & | new_display | ) |
Sets a new display value. If it is set to true messages from this class are to be displayed on the screen; if it is set to false messages from this class are not to be displayed on the screen.
new_display | Display value. |
Definition at line 281 of file neurons_selection.cpp.
void set_maximum_epochs_number | ( | const Index & | new_maximum_epochs_number | ) |
Sets the maximum epochs number for the neurons selection algorithm.
new_maximum_epochs_number | Maximum number of epochs. |
Definition at line 314 of file neurons_selection.cpp.
void set_maximum_neurons_number | ( | const Index & | new_maximum_neurons | ) |
Sets the number of the maximum hidden perceptrons for the neurons selection algorithm.
new_maximum_neurons | Maximum number of hidden perceptrons. |
Definition at line 187 of file neurons_selection.cpp.
void set_maximum_time | ( | const type & | new_maximum_time | ) |
Sets the maximum time for the neurons selection algorithm.
new_maximum_time | Maximum time for the algorithm. |
Definition at line 338 of file neurons_selection.cpp.
void set_minimum_neurons | ( | const Index & | new_minimum_neurons | ) |
Sets the number of the minimum hidden perceptrons for the neurons selection algorithm.
new_minimum_neurons | Minimum number of hidden perceptrons. |
Definition at line 222 of file neurons_selection.cpp.
void set_selection_error_goal | ( | const type & | new_selection_error_goal | ) |
Sets the selection error goal for the neurons selection algorithm.
new_selection_error_goal | Goal of the selection error. |
Definition at line 290 of file neurons_selection.cpp.
void set_training_strategy_pointer | ( | TrainingStrategy * | new_training_strategy_pointer | ) |
Sets a new training strategy pointer.
new_training_strategy_pointer | Pointer to a training strategy object. |
Definition at line 140 of file neurons_selection.cpp.
void set_trials_number | ( | const Index & | new_trials_number | ) |
Sets the number of times that each different neural network is to be trained.
new_trials_number | Number of assays for each set of parameters. |
Definition at line 256 of file neurons_selection.cpp.
string write_stopping_condition | ( | const TrainingResults & | results | ) | const |
Return a string with the stopping condition of the training depending on the training method.
results | Results of the perform_training method. |
Definition at line 362 of file neurons_selection.cpp.
const string write_time | ( | const type & | time | ) | const |
Writes the time from seconds in format HH:mm:ss.
Definition at line 473 of file neurons_selection.cpp.
|
protected |
Display messages to screen.
Definition at line 142 of file neurons_selection.h.
|
protected |
Maximum number of epochs to perform neurons selection. It is used as a stopping criterion.
Definition at line 150 of file neurons_selection.h.
|
protected |
Maximum number of hidden neurons.
Definition at line 134 of file neurons_selection.h.
|
protected |
Maximum selection algorithm time. It is used as a stopping criterion.
Definition at line 154 of file neurons_selection.h.
|
protected |
Minimum number of hidden neurons.
Definition at line 130 of file neurons_selection.h.
|
protected |
Neurons of all the neural networks trained.
Definition at line 118 of file neurons_selection.h.
|
protected |
Goal value for the selection error. It is used as a stopping criterion.
Definition at line 146 of file neurons_selection.h.
|
protected |
Selection loss of all the neural networks trained.
Definition at line 122 of file neurons_selection.h.
|
protected |
Error of all the neural networks trained.
Definition at line 126 of file neurons_selection.h.
|
protected |
Pointer to a training strategy object.
Definition at line 114 of file neurons_selection.h.
|
protected |
Number of trials for each neural network.
Definition at line 138 of file neurons_selection.h.