GrowingNeurons Class Reference

This concrete class represents an growing neurons algorithm for the NeuronsSelection as part of the ModelSelection[1] class. More...

#include <growing_neurons.h>

Inheritance diagram for GrowingNeurons:
NeuronsSelection

Public Member Functions

 GrowingNeurons ()
 Default constructor. More...
 
 GrowingNeurons (TrainingStrategy *)
 
virtual ~GrowingNeurons ()
 Destructor. More...
 
const Index & get_step () const
 Returns the number of the hidden perceptrons pointed in each iteration of the growing neurons algorithm. More...
 
const Index & get_maximum_selection_failures () const
 Returns the maximum number of selection failures in the model neurons selection algorithm. More...
 
void set_default ()
 Sets the members of the model selection object to their default values: More...
 
void set_neurons_increment (const Index &)
 
void set_maximum_selection_failures (const Index &)
 
NeuronsSelectionResults perform_neurons_selection ()
 Perform neurons selection with the growing neurons method. More...
 
Tensor< string, 2 > to_string_matrix () const
 Writes as matrix of strings the most representative atributes. More...
 
void from_XML (const tinyxml2::XMLDocument &)
 
void write_XML (tinyxml2::XMLPrinter &) const
 
void save (const string &) const
 
void load (const string &)
 
- Public Member Functions inherited from NeuronsSelection
 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...
 
const string write_time (const type &) const
 Writes the time from seconds in format HH:mm:ss. More...
 

Private Attributes

Index neurons_increment
 Number of neurons added at each iteration. More...
 
Index maximum_selection_failures
 Maximum number of epochs at which the selection error increases. More...
 

Additional Inherited Members

- Public Types inherited from NeuronsSelection
enum class  StoppingCondition {
  MaximumTime , SelectionErrorGoal , MaximumEpochs , MaximumSelectionFailures ,
  MaximumNeurons
}
 Enumeration of all possibles condition of stop for the algorithms. More...
 
- Protected Attributes inherited from NeuronsSelection
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 concrete class represents an growing neurons algorithm for the NeuronsSelection as part of the ModelSelection[1] class.

[1] Neural Designer "Model Selection Algorithms in Predictive Analytics." https://www.neuraldesigner.com/blog/model-selection

Definition at line 38 of file growing_neurons.h.

Constructor & Destructor Documentation

◆ GrowingNeurons() [1/2]

GrowingNeurons ( )
explicit

Default constructor.

Definition at line 16 of file growing_neurons.cpp.

◆ GrowingNeurons() [2/2]

GrowingNeurons ( TrainingStrategy new_training_strategy_pointer)
explicit

Training strategy constructor.

Parameters
new_training_strategy_pointerPointer to a gradient descent object.

Definition at line 26 of file growing_neurons.cpp.

◆ ~GrowingNeurons()

~GrowingNeurons ( )
virtual

Destructor.

Definition at line 35 of file growing_neurons.cpp.

Member Function Documentation

◆ from_XML()

void from_XML ( const tinyxml2::XMLDocument document)

Deserializes a TinyXML document into this growing neurons object.

Parameters
documentTinyXML document containing the member data.

Definition at line 505 of file growing_neurons.cpp.

◆ get_maximum_selection_failures()

const Index & get_maximum_selection_failures ( ) const

Returns the maximum number of selection failures in the model neurons selection algorithm.

Definition at line 50 of file growing_neurons.cpp.

◆ get_step()

const Index & get_step ( ) const

Returns the number of the hidden perceptrons pointed in each iteration of the growing neurons algorithm.

Definition at line 42 of file growing_neurons.cpp.

◆ load()

void load ( const string &  file_name)

Loads a growing neurons object from a XML-type file.

Parameters
file_nameName of growing neurons XML-type file.

Definition at line 673 of file growing_neurons.cpp.

◆ perform_neurons_selection()

NeuronsSelectionResults perform_neurons_selection ( )
virtual

Perform neurons selection with the growing neurons method.

Implements NeuronsSelection.

Definition at line 125 of file growing_neurons.cpp.

◆ save()

void save ( const string &  file_name) const

Saves to a XML-type file the members of the growing neurons object.

Parameters
file_nameName of growing neurons XML-type file.

Definition at line 658 of file growing_neurons.cpp.

◆ set_default()

void set_default ( )

Sets the members of the model selection object to their default values:

Definition at line 58 of file growing_neurons.cpp.

◆ set_maximum_selection_failures()

void set_maximum_selection_failures ( const Index &  new_maximum_selection_failures)

Sets the maximum selection failures for the growing neurons selection algorithm.

Parameters
new_maximum_selection_failuresMaximum number of selection failures in the growing neurons selection algorithm.

Definition at line 102 of file growing_neurons.cpp.

◆ set_neurons_increment()

void set_neurons_increment ( const Index &  new_neurons_increment)

Sets the number of the hidden perceptrons pointed in each iteration of the growing algorithm in the model neurons selection process.

Parameters
new_stepnumber of hidden perceptrons pointed.

Definition at line 78 of file growing_neurons.cpp.

◆ to_string_matrix()

Tensor< string, 2 > to_string_matrix ( ) const

Writes as matrix of strings the most representative atributes.

Definition at line 320 of file growing_neurons.cpp.

◆ write_XML()

void write_XML ( tinyxml2::XMLPrinter file_stream) const

Serializes the growing neurons object into a XML document of the TinyXML library without keep the DOM tree in memory. See the OpenNN manual for more information about the format of this document.

Definition at line 415 of file growing_neurons.cpp.

Member Data Documentation

◆ maximum_selection_failures

Index maximum_selection_failures
private

Maximum number of epochs at which the selection error increases.

Definition at line 90 of file growing_neurons.h.

◆ neurons_increment

Index neurons_increment
private

Number of neurons added at each iteration.

Definition at line 86 of file growing_neurons.h.


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