OpenNN
Open-source neural networks library
Loading...
Searching...
No Matches
opennn::InputsSelection Class Referenceabstract

Abstract base class for algorithms that search the optimal subset of input variables. More...

#include <inputs_selection.h>

Inheritance diagram for opennn::InputsSelection:
[legend]

Public Types

enum class  StoppingCondition {
  MaximumTime , SelectionErrorGoal , MaximumInputs , MaximumEpochs ,
  MaximumSelectionFailures
}
 Reasons the inputs selection loop may terminate. More...
 

Public Member Functions

 InputsSelection (TrainingStrategy *=nullptr)
 Constructs the algorithm bound to an optional training strategy.
 
virtual ~InputsSelection ()=default
 
const TrainingStrategyget_training_strategy () const
 
bool has_training_strategy () const
 
bool get_display () const
 
virtual Index get_minimum_inputs_number () const =0
 Returns the minimum number of input variables that the algorithm may select.
 
virtual Index get_maximum_inputs_number () const =0
 Returns the maximum number of input variables that the algorithm may select.
 
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.
 
virtual InputsSelectionResults perform_input_selection ()=0
 Runs the inputs selection algorithm until a stopping criterion is met.
 
string get_name () const
 
virtual void from_JSON (const JsonDocument &)=0
 Loads algorithm configuration from a JSON document.
 
virtual void to_JSON (JsonWriter &) const =0
 Writes algorithm configuration to a JSON writer.
 
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.
 

Protected Attributes

TrainingStrategytraining_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
 

Detailed Description

Abstract base class for algorithms that search the optimal subset of input variables.

Member Enumeration Documentation

◆ StoppingCondition

Reasons the inputs selection loop may terminate.

Enumerator
MaximumTime 
SelectionErrorGoal 
MaximumInputs 
MaximumEpochs 
MaximumSelectionFailures 

Constructor & Destructor Documentation

◆ InputsSelection()

opennn::InputsSelection::InputsSelection ( TrainingStrategy * = nullptr)

Constructs the algorithm bound to an optional training strategy.

◆ ~InputsSelection()

virtual opennn::InputsSelection::~InputsSelection ( )
virtualdefault

Member Function Documentation

◆ check()

void opennn::InputsSelection::check ( ) const

Verifies that the training strategy and its dependencies are valid for inputs selection.

◆ from_JSON()

virtual void opennn::InputsSelection::from_JSON ( const JsonDocument & )
pure virtual

Loads algorithm configuration from a JSON document.

Implemented in opennn::GeneticAlgorithm, and opennn::GrowingInputs.

◆ get_display()

bool opennn::InputsSelection::get_display ( ) const
inline

◆ get_maximum_inputs_number()

virtual Index opennn::InputsSelection::get_maximum_inputs_number ( ) const
pure virtual

Returns the maximum number of input variables that the algorithm may select.

Implemented in opennn::GeneticAlgorithm, and opennn::GrowingInputs.

◆ get_minimum_inputs_number()

virtual Index opennn::InputsSelection::get_minimum_inputs_number ( ) const
pure virtual

Returns the minimum number of input variables that the algorithm may select.

Implemented in opennn::GeneticAlgorithm, and opennn::GrowingInputs.

◆ get_name()

string opennn::InputsSelection::get_name ( ) const
inline

◆ get_training_strategy()

const TrainingStrategy * opennn::InputsSelection::get_training_strategy ( ) const
inline

◆ has_training_strategy()

bool opennn::InputsSelection::has_training_strategy ( ) const
inline

◆ load()

void opennn::InputsSelection::load ( const filesystem::path & )

Loads the algorithm configuration from disk.

◆ perform_input_selection()

virtual InputsSelectionResults opennn::InputsSelection::perform_input_selection ( )
pure virtual

Runs the inputs selection algorithm until a stopping criterion is met.

Returns
Results including the chosen inputs, optimal parameters and error histories.

Implemented in opennn::GeneticAlgorithm, and opennn::GrowingInputs.

◆ print()

virtual void opennn::InputsSelection::print ( ) const
inlinevirtual

Prints a human-readable description of the algorithm to stdout.

◆ save()

void opennn::InputsSelection::save ( const filesystem::path & ) const

Saves the algorithm configuration to disk.

◆ set()

void opennn::InputsSelection::set ( TrainingStrategy * new_training_strategy)
inline

◆ set_display()

void opennn::InputsSelection::set_display ( bool new_display)
inline

◆ set_maximum_epochs()

void opennn::InputsSelection::set_maximum_epochs ( const Index new_maximum_epochs)
inline

◆ set_maximum_time()

void opennn::InputsSelection::set_maximum_time ( const float new_maximum_time)
inline

◆ set_maximum_validation_failures()

void opennn::InputsSelection::set_maximum_validation_failures ( const Index new_maximum_validation_failures)
inline

◆ set_trials_number()

void opennn::InputsSelection::set_trials_number ( const Index new_trials_number)
inline

◆ set_validation_error_goal()

void opennn::InputsSelection::set_validation_error_goal ( const float new_validation_error_goal)
inline

◆ to_JSON()

virtual void opennn::InputsSelection::to_JSON ( JsonWriter & ) const
pure virtual

Writes algorithm configuration to a JSON writer.

Implemented in opennn::GeneticAlgorithm, and opennn::GrowingInputs.

Member Data Documentation

◆ display

bool opennn::InputsSelection::display = true
protected

◆ maximum_epochs

Index opennn::InputsSelection::maximum_epochs
protected

◆ maximum_time

float opennn::InputsSelection::maximum_time
protected

◆ maximum_validation_failures

Index opennn::InputsSelection::maximum_validation_failures = 100
protected

◆ name

string opennn::InputsSelection::name
protected

◆ training_strategy

TrainingStrategy* opennn::InputsSelection::training_strategy = nullptr
protected

◆ trials_number

Index opennn::InputsSelection::trials_number = 1
protected

◆ validation_error_goal

float opennn::InputsSelection::validation_error_goal
protected