NeuronsSelection Class Referenceabstract

This abstract class represents the concept of neurons selection algorithm for a ModelSelection[1]. More...

#include <neurons_selection.h>

Inheritance diagram for NeuronsSelection:
GrowingNeurons

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...
 
TrainingStrategyget_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

TrainingStrategytraining_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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ StoppingCondition

enum class StoppingCondition
strong

Enumeration of all possibles condition of stop for the algorithms.

Definition at line 56 of file neurons_selection.h.

Constructor & Destructor Documentation

◆ NeuronsSelection() [1/2]

NeuronsSelection ( )
explicit

Default constructor.

Definition at line 16 of file neurons_selection.cpp.

◆ NeuronsSelection() [2/2]

NeuronsSelection ( TrainingStrategy new_training_strategy_pointer)
explicit

Training strategy constructor.

Parameters
new_training_strategy_pointerPointer to a training strategy object.

Definition at line 27 of file neurons_selection.cpp.

◆ ~NeuronsSelection()

~NeuronsSelection ( )
virtual

Destructor.

Definition at line 37 of file neurons_selection.cpp.

Member Function Documentation

◆ check()

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.

◆ delete_selection_history()

void delete_selection_history ( )

Delete the history of the selection error values.

Definition at line 370 of file neurons_selection.cpp.

◆ delete_training_error_history()

void delete_training_error_history ( )

Delete the history of the loss values.

Definition at line 378 of file neurons_selection.cpp.

◆ get_display()

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.

◆ get_maximum_epochs_number()

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.

◆ get_maximum_neurons()

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.

◆ get_maximum_time()

const type & get_maximum_time ( ) const

Returns the maximum time in the neurons selection algorithm.

Definition at line 131 of file neurons_selection.cpp.

◆ get_minimum_neurons()

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.

◆ get_selection_error_goal()

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.

◆ get_training_strategy_pointer()

TrainingStrategy * get_training_strategy_pointer ( ) const

Returns a pointer to the training strategy object.

Definition at line 44 of file neurons_selection.cpp.

◆ get_trials_number()

const Index & get_trials_number ( ) const

Returns the number of trials for each network architecture.

Definition at line 98 of file neurons_selection.cpp.

◆ has_training_strategy()

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.

◆ perform_neurons_selection()

virtual NeuronsSelectionResults perform_neurons_selection ( )
pure virtual

Performs the neurons selection for a neural network.

Implemented in GrowingNeurons.

◆ set_default()

void set_default ( )

Sets the members of the neurons selection object to their default values.

Definition at line 148 of file neurons_selection.cpp.

◆ set_display()

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.

Parameters
new_displayDisplay value.

Definition at line 281 of file neurons_selection.cpp.

◆ set_maximum_epochs_number()

void set_maximum_epochs_number ( const Index &  new_maximum_epochs_number)

Sets the maximum epochs number for the neurons selection algorithm.

Parameters
new_maximum_epochs_numberMaximum number of epochs.

Definition at line 314 of file neurons_selection.cpp.

◆ set_maximum_neurons_number()

void set_maximum_neurons_number ( const Index &  new_maximum_neurons)

Sets the number of the maximum hidden perceptrons for the neurons selection algorithm.

Parameters
new_maximum_neuronsMaximum number of hidden perceptrons.

Definition at line 187 of file neurons_selection.cpp.

◆ set_maximum_time()

void set_maximum_time ( const type &  new_maximum_time)

Sets the maximum time for the neurons selection algorithm.

Parameters
new_maximum_timeMaximum time for the algorithm.

Definition at line 338 of file neurons_selection.cpp.

◆ set_minimum_neurons()

void set_minimum_neurons ( const Index &  new_minimum_neurons)

Sets the number of the minimum hidden perceptrons for the neurons selection algorithm.

Parameters
new_minimum_neuronsMinimum number of hidden perceptrons.

Definition at line 222 of file neurons_selection.cpp.

◆ set_selection_error_goal()

void set_selection_error_goal ( const type &  new_selection_error_goal)

Sets the selection error goal for the neurons selection algorithm.

Parameters
new_selection_error_goalGoal of the selection error.

Definition at line 290 of file neurons_selection.cpp.

◆ set_training_strategy_pointer()

void set_training_strategy_pointer ( TrainingStrategy new_training_strategy_pointer)

Sets a new training strategy pointer.

Parameters
new_training_strategy_pointerPointer to a training strategy object.

Definition at line 140 of file neurons_selection.cpp.

◆ set_trials_number()

void set_trials_number ( const Index &  new_trials_number)

Sets the number of times that each different neural network is to be trained.

Parameters
new_trials_numberNumber of assays for each set of parameters.

Definition at line 256 of file neurons_selection.cpp.

◆ write_stopping_condition()

string write_stopping_condition ( const TrainingResults results) const

Return a string with the stopping condition of the training depending on the training method.

Parameters
resultsResults of the perform_training method.

Definition at line 362 of file neurons_selection.cpp.

◆ write_time()

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.

Member Data Documentation

◆ display

bool display = true
protected

Display messages to screen.

Definition at line 142 of file neurons_selection.h.

◆ maximum_epochs_number

Index maximum_epochs_number
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.

◆ maximum_neurons

Index maximum_neurons
protected

Maximum number of hidden neurons.

Definition at line 134 of file neurons_selection.h.

◆ maximum_time

type maximum_time
protected

Maximum selection algorithm time. It is used as a stopping criterion.

Definition at line 154 of file neurons_selection.h.

◆ minimum_neurons

Index minimum_neurons
protected

Minimum number of hidden neurons.

Definition at line 130 of file neurons_selection.h.

◆ neurons_history

Tensor<Index, 1> neurons_history
protected

Neurons of all the neural networks trained.

Definition at line 118 of file neurons_selection.h.

◆ selection_error_goal

type selection_error_goal
protected

Goal value for the selection error. It is used as a stopping criterion.

Definition at line 146 of file neurons_selection.h.

◆ selection_error_history

Tensor<type, 1> selection_error_history
protected

Selection loss of all the neural networks trained.

Definition at line 122 of file neurons_selection.h.

◆ training_error_history

Tensor<type, 1> training_error_history
protected

Error of all the neural networks trained.

Definition at line 126 of file neurons_selection.h.

◆ training_strategy_pointer

TrainingStrategy* training_strategy_pointer = nullptr
protected

Pointer to a training strategy object.

Definition at line 114 of file neurons_selection.h.

◆ trials_number

Index trials_number = 1
protected

Number of trials for each neural network.

Definition at line 138 of file neurons_selection.h.


The documentation for this class was generated from the following files: