|
OpenNN
Open-source neural networks library
|
Selects the optimal subset of input features using an evolutionary genetic algorithm. More...
#include <genetic_algorithm.h>
Public Member Functions | |
| GeneticAlgorithm (TrainingStrategy *=nullptr) | |
| Constructs the algorithm bound to an optional training strategy. | |
| Index | get_individuals_number () const |
| Index | get_genes_number () const |
| void | set_default () |
| Restores default population size, mutation rate, elitism and other parameters. | |
| Index | get_minimum_inputs_number () const override |
| Returns the minimum number of input variables that the algorithm may select. | |
| Index | get_maximum_inputs_number () const override |
| Returns the maximum number of input variables that the algorithm may select. | |
| void | set_minimum_inputs_number (const Index new_minimum) |
| void | set_maximum_inputs_number (const Index) |
| Sets the upper bound on the number of selected inputs. | |
| void | set_individuals_number (const Index new_individuals_number=4) |
| Sets the size of the population evolved by the algorithm. | |
| void | set_initialization_method (string method) |
| void | set_mutation_rate (const float rate) |
| void | set_elitism_size (const Index size) |
| InputsSelectionResults | perform_input_selection () override |
| Runs the genetic algorithm until the stopping criterion is met. | |
| void | from_JSON (const JsonDocument &) override |
| Loads algorithm configuration from a JSON document. | |
| void | to_JSON (JsonWriter &) const override |
| Writes algorithm configuration to a JSON writer. | |
Public Member Functions inherited from opennn::InputsSelection | |
| InputsSelection (TrainingStrategy *=nullptr) | |
| Constructs the algorithm bound to an optional training strategy. | |
| virtual | ~InputsSelection ()=default |
| const TrainingStrategy * | get_training_strategy () const |
| bool | has_training_strategy () const |
| bool | get_display () const |
| void | set (TrainingStrategy *new_training_strategy) |
| void | set_trials_number (const Index new_trials_number) |
| void | set_display (bool new_display) |
| void | set_validation_error_goal (const float new_validation_error_goal) |
| void | set_maximum_epochs (const Index new_maximum_epochs) |
| void | set_maximum_validation_failures (const Index new_maximum_validation_failures) |
| void | set_maximum_time (const float new_maximum_time) |
| void | check () const |
| Verifies that the training strategy and its dependencies are valid for inputs selection. | |
| string | get_name () const |
| void | save (const filesystem::path &) const |
| Saves the algorithm configuration to disk. | |
| void | load (const filesystem::path &) |
| Loads the algorithm configuration from disk. | |
| virtual void | print () const |
| Prints a human-readable description of the algorithm to stdout. | |
Additional Inherited Members | |
Public Types inherited from opennn::InputsSelection | |
| enum class | StoppingCondition { MaximumTime , SelectionErrorGoal , MaximumInputs , MaximumEpochs , MaximumSelectionFailures } |
| Reasons the inputs selection loop may terminate. More... | |
Protected Attributes inherited from opennn::InputsSelection | |
| TrainingStrategy * | training_strategy = nullptr |
| Index | trials_number = 1 |
| bool | display = true |
| float | validation_error_goal |
| Index | maximum_epochs |
| Index | maximum_validation_failures = 100 |
| float | maximum_time |
| string | name |
Selects the optimal subset of input features using an evolutionary genetic algorithm.
| opennn::GeneticAlgorithm::GeneticAlgorithm | ( | TrainingStrategy * | = nullptr | ) |
Constructs the algorithm bound to an optional training strategy.
|
overridevirtual |
Loads algorithm configuration from a JSON document.
Implements opennn::InputsSelection.
|
inline |
|
inline |
|
inlineoverridevirtual |
Returns the maximum number of input variables that the algorithm may select.
Implements opennn::InputsSelection.
|
inlineoverridevirtual |
Returns the minimum number of input variables that the algorithm may select.
Implements opennn::InputsSelection.
|
overridevirtual |
Runs the genetic algorithm until the stopping criterion is met.
Implements opennn::InputsSelection.
| void opennn::GeneticAlgorithm::set_default | ( | ) |
Restores default population size, mutation rate, elitism and other parameters.
|
inline |
| void opennn::GeneticAlgorithm::set_individuals_number | ( | const Index | new_individuals_number = 4 | ) |
Sets the size of the population evolved by the algorithm.
|
inline |
| void opennn::GeneticAlgorithm::set_maximum_inputs_number | ( | const Index | ) |
Sets the upper bound on the number of selected inputs.
|
inline |
|
inline |
|
overridevirtual |
Writes algorithm configuration to a JSON writer.
Implements opennn::InputsSelection.