This class represents the concept of model selection[1] algorithm in OpenNN. More...
#include <model_selection.h>
Public Types | |
enum class | NeuronsSelectionMethod { GROWING_NEURONS } |
Enumeration of all the available neurons selection algorithms. More... | |
enum class | InputsSelectionMethod { GROWING_INPUTS , PRUNING_INPUTS , GENETIC_ALGORITHM } |
Enumeration of all the available inputs selection algorithms. More... | |
Public Member Functions | |
ModelSelection () | |
Default constructor. More... | |
ModelSelection (TrainingStrategy *) | |
virtual | ~ModelSelection () |
Destructor. More... | |
TrainingStrategy * | get_training_strategy_pointer () const |
Returns a pointer to the training strategy object. More... | |
bool | has_training_strategy () const |
const NeuronsSelectionMethod & | get_neurons_selection_method () const |
Returns the type of algorithm for the neurons selection. More... | |
const InputsSelectionMethod & | get_inputs_selection_method () const |
Returns the type of algorithm for the inputs selection. More... | |
GrowingNeurons * | get_growing_neurons_pointer () |
Returns a pointer to the growing neurons selection algorithm. More... | |
GrowingInputs * | get_growing_inputs_pointer () |
Returns a pointer to the growing inputs selection algorithm. More... | |
PruningInputs * | get_pruning_inputs_pointer () |
Returns a pointer to the pruning inputs selection algorithm. More... | |
GeneticAlgorithm * | get_genetic_algorithm_pointer () |
Returns a pointer to the genetic inputs selection algorithm. More... | |
void | set (TrainingStrategy *) |
void | set_default () |
Sets the members of the model selection object to their default values. More... | |
void | set_display (const bool &) |
void | set_neurons_selection_method (const NeuronsSelectionMethod &) |
void | set_neurons_selection_method (const string &) |
void | set_inputs_selection_method (const InputsSelectionMethod &) |
void | set_inputs_selection_method (const string &) |
void | check () const |
Checks that the different pointers needed for performing the model selection are not nullptr. More... | |
NeuronsSelectionResults | perform_neurons_selection () |
InputsSelectionResults | perform_inputs_selection () |
void | from_XML (const tinyxml2::XMLDocument &) |
void | write_XML (tinyxml2::XMLPrinter &) const |
string | write_neurons_selection_method () const |
string | write_inputs_selection_method () const |
void | print () const |
Prints to the screen the XML representation of this model selection object. More... | |
void | save (const string &) const |
void | load (const string &) |
Private Attributes | |
TrainingStrategy * | training_strategy_pointer = nullptr |
Pointer to a training strategy object. More... | |
GrowingNeurons | growing_neurons |
Growing neurons object to be used for neurons selection. More... | |
GrowingInputs | growing_inputs |
Growing inputs object to be used for inputs selection. More... | |
PruningInputs | pruning_inputs |
Pruning inputs object to be used for inputs selection. More... | |
GeneticAlgorithm | genetic_algorithm |
Genetic algorithm object to be used for inputs selection. More... | |
NeuronsSelectionMethod | neurons_selection_method |
Type of neurons selection algorithm. More... | |
InputsSelectionMethod | inputs_selection_method |
Type of inputs selection algorithm. More... | |
bool | display = true |
Display messages to screen. More... | |
This class represents the concept of model selection[1] algorithm in OpenNN.
It is used for finding a network architecture with maximum generalization capabilities.
[1] Neural Designer "Model Selection Algorithms in Predictive Analytics." https://www.neuraldesigner.com/blog/model-selection
Definition at line 40 of file model_selection.h.
|
strong |
Enumeration of all the available inputs selection algorithms.
Definition at line 61 of file model_selection.h.
|
strong |
Enumeration of all the available neurons selection algorithms.
Definition at line 57 of file model_selection.h.
|
explicit |
Default constructor.
Definition at line 16 of file model_selection.cpp.
|
explicit |
Training strategy constructor.
new_training_strategy_pointer | Pointer to a training strategy object. |
Definition at line 25 of file model_selection.cpp.
|
virtual |
Destructor.
Definition at line 35 of file model_selection.cpp.
void check | ( | ) | const |
Checks that the different pointers needed for performing the model selection are not nullptr.
Definition at line 254 of file model_selection.cpp.
void from_XML | ( | const tinyxml2::XMLDocument & | document | ) |
Loads the members of this model selection object from a XML document.
document | XML document of the TinyXML library. |
Definition at line 412 of file model_selection.cpp.
GeneticAlgorithm * get_genetic_algorithm_pointer | ( | ) |
Returns a pointer to the genetic inputs selection algorithm.
Definition at line 121 of file model_selection.cpp.
GrowingInputs * get_growing_inputs_pointer | ( | ) |
Returns a pointer to the growing inputs selection algorithm.
Definition at line 105 of file model_selection.cpp.
GrowingNeurons * get_growing_neurons_pointer | ( | ) |
Returns a pointer to the growing neurons selection algorithm.
Definition at line 97 of file model_selection.cpp.
const ModelSelection::InputsSelectionMethod & get_inputs_selection_method | ( | ) | const |
Returns the type of algorithm for the inputs selection.
Definition at line 89 of file model_selection.cpp.
const ModelSelection::NeuronsSelectionMethod & get_neurons_selection_method | ( | ) | const |
Returns the type of algorithm for the neurons selection.
Definition at line 81 of file model_selection.cpp.
PruningInputs * get_pruning_inputs_pointer | ( | ) |
Returns a pointer to the pruning inputs selection algorithm.
Definition at line 113 of file model_selection.cpp.
TrainingStrategy * get_training_strategy_pointer | ( | ) | const |
Returns a pointer to the training strategy object.
Definition at line 42 of file model_selection.cpp.
bool has_training_strategy | ( | ) | const |
Returns true if this model selection has a training strategy associated, and false otherwise.
Definition at line 66 of file model_selection.cpp.
void load | ( | const string & | file_name | ) |
Loads the model selection members from a XML file.
file_name | Name of model selection XML file. |
Definition at line 595 of file model_selection.cpp.
InputsSelectionResults perform_inputs_selection | ( | ) |
Perform the inputs selection, returns a structure with the results of the inputs selection. It also set the neural network of the training strategy pointer with the optimum parameters.
Definition at line 350 of file model_selection.cpp.
NeuronsSelectionResults perform_neurons_selection | ( | ) |
Perform the neurons selection, returns a structure with the results of the neurons selection. It also set the neural network of the training strategy pointer with the optimum parameters.
Definition at line 335 of file model_selection.cpp.
void print | ( | ) | const |
Prints to the screen the XML representation of this model selection object.
Definition at line 571 of file model_selection.cpp.
void save | ( | const string & | file_name | ) | const |
Saves the model selection members to a XML file.
file_name | Name of model selection XML file. |
Definition at line 580 of file model_selection.cpp.
void set | ( | TrainingStrategy * | new_training_strategy_pointer | ) |
Sets a new training strategy pointer.
new_training_strategy_pointer | Pointer to a training strategy object. |
Definition at line 236 of file model_selection.cpp.
void set_default | ( | ) |
Sets the members of the model selection object to their default values.
Definition at line 129 of file model_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 144 of file model_selection.cpp.
void set_inputs_selection_method | ( | const InputsSelectionMethod & | new_inputs_selection_method | ) |
Sets a new method for selecting the inputs which have more impact on the targets.
new_inputs_selection_method | Method for selecting the inputs(GROWING_INPUTS, PRUNING_INPUTS, GENETIC_ALGORITHM). |
Definition at line 197 of file model_selection.cpp.
void set_inputs_selection_method | ( | const string & | new_inputs_selection_method | ) |
Sets a new inputs selection algorithm from a string.
new_inputs_selection_method | String with the inputs selection type. |
Definition at line 206 of file model_selection.cpp.
void set_neurons_selection_method | ( | const NeuronsSelectionMethod & | new_neurons_selection_method | ) |
Sets a new method for selecting the order which have more impact on the targets.
new_neurons_selection_method | Method for selecting the order(NO_NEURONS_SELECTION, growing_neurons, GOLDEN_SECTION, SIMULATED_ANNEALING). |
Definition at line 166 of file model_selection.cpp.
void set_neurons_selection_method | ( | const string & | new_neurons_selection_method | ) |
Sets a new neurons selection algorithm from a string.
new_neurons_selection_method | String with the neurons selection type. |
Definition at line 175 of file model_selection.cpp.
string write_inputs_selection_method | ( | ) | const |
Definition at line 551 of file model_selection.cpp.
string write_neurons_selection_method | ( | ) | const |
Definition at line 539 of file model_selection.cpp.
void write_XML | ( | tinyxml2::XMLPrinter & | file_stream | ) | const |
Serializes the model selection 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 371 of file model_selection.cpp.
|
private |
Display messages to screen.
Definition at line 144 of file model_selection.h.
|
private |
Genetic algorithm object to be used for inputs selection.
Definition at line 132 of file model_selection.h.
|
private |
Growing inputs object to be used for inputs selection.
Definition at line 124 of file model_selection.h.
|
private |
Growing neurons object to be used for neurons selection.
Definition at line 120 of file model_selection.h.
|
private |
Type of inputs selection algorithm.
Definition at line 140 of file model_selection.h.
|
private |
Type of neurons selection algorithm.
Definition at line 136 of file model_selection.h.
|
private |
Pruning inputs object to be used for inputs selection.
Definition at line 128 of file model_selection.h.
|
private |
Pointer to a training strategy object.
Definition at line 116 of file model_selection.h.