This concrete class represents an growing neurons algorithm for the NeuronsSelection as part of the ModelSelection[1] class. More...
#include <growing_neurons.h>
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... | |
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... | |
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 | |
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 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.
|
explicit |
Default constructor.
Definition at line 16 of file growing_neurons.cpp.
|
explicit |
Training strategy constructor.
new_training_strategy_pointer | Pointer to a gradient descent object. |
Definition at line 26 of file growing_neurons.cpp.
|
virtual |
Destructor.
Definition at line 35 of file growing_neurons.cpp.
void from_XML | ( | const tinyxml2::XMLDocument & | document | ) |
Deserializes a TinyXML document into this growing neurons object.
document | TinyXML document containing the member data. |
Definition at line 505 of file growing_neurons.cpp.
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.
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.
void load | ( | const string & | file_name | ) |
Loads a growing neurons object from a XML-type file.
file_name | Name of growing neurons XML-type file. |
Definition at line 673 of file growing_neurons.cpp.
|
virtual |
Perform neurons selection with the growing neurons method.
Implements NeuronsSelection.
Definition at line 125 of file growing_neurons.cpp.
void save | ( | const string & | file_name | ) | const |
Saves to a XML-type file the members of the growing neurons object.
file_name | Name of growing neurons XML-type file. |
Definition at line 658 of file growing_neurons.cpp.
void set_default | ( | ) |
Sets the members of the model selection object to their default values:
Definition at line 58 of file growing_neurons.cpp.
void set_maximum_selection_failures | ( | const Index & | new_maximum_selection_failures | ) |
Sets the maximum selection failures for the growing neurons selection algorithm.
new_maximum_selection_failures | Maximum number of selection failures in the growing neurons selection algorithm. |
Definition at line 102 of file growing_neurons.cpp.
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.
new_step | number of hidden perceptrons pointed. |
Definition at line 78 of file growing_neurons.cpp.
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.
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.
|
private |
Maximum number of epochs at which the selection error increases.
Definition at line 90 of file growing_neurons.h.
|
private |
Number of neurons added at each iteration.
Definition at line 86 of file growing_neurons.h.