#include <training_strategy.h>
Definition at line 40 of file training_strategy.h.
Enumeration of all the available types of training algorithms.
Definition at line 69 of file training_strategy.h.
OpenNN::TrainingStrategy::TrainingStrategy | ( | void | ) | [explicit] |
Default constructor. It creates a training strategy object not associated to any performance functional object. It also constructs the main training algorithm object.
Definition at line 53 of file training_strategy.cpp.
OpenNN::TrainingStrategy::TrainingStrategy | ( | PerformanceFunctional * | new_performance_functional_pointer | ) | [explicit] |
Performance functional constructor. It creates a training strategy object associated to a performance functional object. It also constructs the main training algorithm object.
new_performance_functional_pointer | Pointer to a performance functional object. |
Definition at line 72 of file training_strategy.cpp.
OpenNN::TrainingStrategy::TrainingStrategy | ( | TiXmlElement * | training_strategy_element | ) | [explicit] |
XML constructor. It creates a training strategy object not associated to any performance functional object. It also loads the members of this object from a XML element.
training_strategy_element | Pointer to an element of the Tiny XML library. |
Definition at line 91 of file training_strategy.cpp.
OpenNN::TrainingStrategy::TrainingStrategy | ( | const std::string & | filename | ) | [explicit] |
File constructor. It creates a training strategy object associated to a performance functional object. It also loads the members of this object from a XML file.
filename | Name of training strategy XML file. |
Definition at line 111 of file training_strategy.cpp.
OpenNN::TrainingStrategy::~TrainingStrategy | ( | void | ) | [virtual] |
Destructor. This destructor deletes the initialization, main and refinement training algorithm objects.
Definition at line 128 of file training_strategy.cpp.
PerformanceFunctional * OpenNN::TrainingStrategy::get_performance_functional_pointer | ( | void | ) | const |
This method returns a pointer to the performance functional object to which the training strategy is associated.
Definition at line 142 of file training_strategy.cpp.
TrainingAlgorithm * OpenNN::TrainingStrategy::get_initialization_training_algorithm_pointer | ( | void | ) | const |
This method returns a pointer to the initialization training algorithm object composing this training strategy object.
Definition at line 152 of file training_strategy.cpp.
TrainingAlgorithm * OpenNN::TrainingStrategy::get_main_training_algorithm_pointer | ( | void | ) | const |
This method returns a pointer to the main training algorithm object composing this training strategy object.
Definition at line 162 of file training_strategy.cpp.
TrainingAlgorithm * OpenNN::TrainingStrategy::get_refinement_training_algorithm_pointer | ( | void | ) | const |
This method returns a pointer to the refinement training algorithm object composing this training strategy object.
Definition at line 172 of file training_strategy.cpp.
const TrainingStrategy::TrainingAlgorithmType & OpenNN::TrainingStrategy::get_initialization_training_algorithm_type | ( | void | ) | const |
This method returns the type of the initialization training algorithm composing this training strategy object.
Definition at line 182 of file training_strategy.cpp.
const TrainingStrategy::TrainingAlgorithmType & OpenNN::TrainingStrategy::get_main_training_algorithm_type | ( | void | ) | const |
This method returns the type of the main training algorithm composing this training strategy object.
Definition at line 192 of file training_strategy.cpp.
const TrainingStrategy::TrainingAlgorithmType & OpenNN::TrainingStrategy::get_refinement_training_algorithm_type | ( | void | ) | const |
This method returns the type of the refinement training algorithm composing this training strategy object.
Definition at line 202 of file training_strategy.cpp.
std::string OpenNN::TrainingStrategy::write_initialization_training_algorithm_type | ( | void | ) | const |
This method returns a string with the type of the initialization training algorithm composing this training strategy object.
Definition at line 212 of file training_strategy.cpp.
std::string OpenNN::TrainingStrategy::write_main_training_algorithm_type | ( | void | ) | const |
This method returns a string with the type of the main training algorithm composing this training strategy object.
Definition at line 267 of file training_strategy.cpp.
std::string OpenNN::TrainingStrategy::write_refinement_training_algorithm_type | ( | void | ) | const |
This method returns a string with the type of the refinement training algorithm composing this training strategy object.
Definition at line 322 of file training_strategy.cpp.
const bool & OpenNN::TrainingStrategy::get_initialization_training_algorithm_flag | ( | void | ) |
This method returns the flag value for applying or not the initialization training algorithm within the training strategy.
Definition at line 377 of file training_strategy.cpp.
const bool & OpenNN::TrainingStrategy::get_main_training_algorithm_flag | ( | void | ) |
This method returns the flag value for applying or not the main training algorithm within the training strategy.
Definition at line 387 of file training_strategy.cpp.
const bool & OpenNN::TrainingStrategy::get_refinement_training_algorithm_flag | ( | void | ) |
This method returns the flag value for applying or not the refinement training algorithm within the training strategy.
Definition at line 397 of file training_strategy.cpp.
const bool & OpenNN::TrainingStrategy::get_display | ( | void | ) | const |
This method returns true if messages from this class can be displayed on the screen, or false if messages from this class can't be displayed on the screen.
Definition at line 408 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set | ( | void | ) |
This method sets the performance functional pointer to NULL. It also destructs the initialization, main and refinement training algorithms. Finally, it sets the rest of members to their default values.
Definition at line 420 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set | ( | PerformanceFunctional * | new_performance_functional_pointer | ) |
This method sets a new performance functional pointer. It also destructs the initialization, main and refinement training algorithms. Finally, it sets the rest of members to their default values.
new_performance_functional_pointer | Pointer to a performance functional object. |
Definition at line 439 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_default | ( | void | ) | [virtual] |
This method sets the members of the training strategy object to their default values:
Definition at line 761 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_performance_functional_pointer | ( | PerformanceFunctional * | new_performance_functional_pointer | ) |
This method sets a pointer to a performance functional object to be associated to the training strategy.
new_performance_functional_pointer | Pointer to a performance functional object. |
Definition at line 696 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_initialization_training_algorithm_pointer | ( | TrainingAlgorithm * | new_initialization_training_algorithm_pointer | ) |
This method sets a new initialization training algorithm to be part of the training strategy. Note that the training algorithms are deleted by the training strategy destructor.
Definition at line 707 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_main_training_algorithm_pointer | ( | TrainingAlgorithm * | new_main_training_algorithm_pointer | ) |
This method sets a new main training algorithm to be part of the training strategy. Note that the training algorithms are deleted by the training strategy destructor.
Definition at line 718 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_refinement_training_algorithm_pointer | ( | TrainingAlgorithm * | new_refinement_training_algorithm_pointer | ) |
This method sets a new refinement training algorithm to be part of the training strategy. Note that the training algorithms are deleted by the training strategy destructor.
Definition at line 729 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_initialization_training_algorithm_type | ( | const TrainingAlgorithmType & | new_initialization_training_algorithm_type | ) |
This method sets a new type of initialization training algorithm. Note that it neither sets the training algorithm object nor the flag.
new_initialization_training_algorithm_type | Type of initialization training algorithm. |
Definition at line 490 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_main_training_algorithm_type | ( | const TrainingAlgorithmType & | new_main_training_algorithm_type | ) |
This method sets a new type of main training algorithm. Note that it neither sets the training algorithm object nor the flag.
new_main_training_algorithm_type | Type of main training algorithm. |
Definition at line 502 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_refinement_training_algorithm_type | ( | const TrainingAlgorithmType & | new_refinement_training_algorithm_type | ) |
This method sets a new type of refinement training algorithm. Note that it neither sets the training algorithm object nor the flag.
new_refinement_training_algorithm_type | Type of refinement training algorithm. |
Definition at line 514 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_initialization_training_algorithm_type | ( | const std::string & | new_training_algorithm_type | ) |
This method sets the initialization training algorithm type from a string. Note that it neither sets the training algorithm object nor the flag.
new_training_algorithm_type | String with the initialization training algorithm type. |
Definition at line 526 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_main_training_algorithm_type | ( | const std::string & | new_training_algorithm_type | ) |
This method sets the main training algorithm type from a string. Note that it neither sets the training algorithm object nor the flag.
new_training_algorithm_type | String with the main training algorithm type. |
Definition at line 583 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_refinement_training_algorithm_type | ( | const std::string & | new_training_algorithm_type | ) |
This method sets the refinement training algorithm type from a string. Note that it neither sets the training algorithm object nor the flag.
new_training_algorithm_type | String with the refinement training algorithm type. |
Definition at line 640 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_initialization_training_algorithm_flag | ( | const bool & | new_initialization_training_algorithm_flag | ) |
This method sets a new flag for using the initialization training algorithm within the training strategy.
new_initialization_training_algorithm_flag | Flag for using or not this algorithm within the strategy. |
Definition at line 456 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_main_training_algorithm_flag | ( | const bool & | new_main_training_algorithm_flag | ) |
This method sets a new flag for using the main training algorithm within the training strategy.
new_main_training_algorithm_flag | Flag for using or not this algorithm within the strategy. |
Definition at line 467 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_refinement_training_algorithm_flag | ( | const bool & | new_refinement_training_algorithm_flag | ) |
This method sets a new flag for using the refinement training algorithm within the training strategy.
new_refinement_training_algorithm_flag | Flag for using or not this algorithm within the strategy. |
Definition at line 478 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::set_display | ( | const bool & | new_display | ) |
This method 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 742 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::construct_initialization_training_algorithm | ( | const TrainingAlgorithmType & | new_training_algorithm_type | ) |
This method constructs the initialization training algorithm object, given its type. It also sets the type of that training algorithm. Finally, it sets the initialization training algorithm flag to true.
new_training_algorithm_type | Type of initialization training algorithm. |
Definition at line 782 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::construct_main_training_algorithm | ( | const TrainingAlgorithmType & | new_training_algorithm_type | ) |
This method constructs the main training algorithm object, given its type. It also sets the type of that training algorithm. Finally, it sets the main training algorithm flag to true.
new_training_algorithm_type | Type of main training algorithm. |
Definition at line 864 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::construct_refinement_training_algorithm | ( | const TrainingAlgorithmType & | new_training_algorithm_type | ) |
This method constructs the refinement training algorithm object, given its type. It also sets the type of that training algorithm. Finally, it sets the refinement training algorithm flag to true.
new_training_algorithm_type | Type of refinement training algorithm. |
Definition at line 946 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::destruct_initialization_training_algorithm | ( | void | ) |
This method deletes the initialization training algorithm object which composes this training strategy object.
Definition at line 1025 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::destruct_main_training_algorithm | ( | void | ) |
This method deletes the main training algorithm object which composes this training strategy object.
Definition at line 1041 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::destruct_refinement_training_algorithm | ( | void | ) |
This method deletes the refinement training algorithm object which composes this training strategy object.
Definition at line 1057 of file training_strategy.cpp.
TrainingStrategy::Results OpenNN::TrainingStrategy::perform_training | ( | void | ) |
This is the most important method of this class. It optimizes the performance functional of a neural network. The most general training strategy consists of three steps: initialization, main and refinement training processes. This method also returns a structure with the results from training.
Definition at line 1076 of file training_strategy.cpp.
std::string OpenNN::TrainingStrategy::to_string | ( | void | ) | const |
This method returns a string representation of the training strategy.
Definition at line 1153 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::print | ( | void | ) | const |
This method prints to the screen the string representation of the training strategy object.
Definition at line 1191 of file training_strategy.cpp.
TiXmlElement * OpenNN::TrainingStrategy::to_XML | ( | void | ) | const [virtual] |
This method returns a default string representation in XML-type format of the training algorithm object. This containts the training operators, the training parameters, stopping criteria and other stuff.
Definition at line 1202 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::from_XML | ( | TiXmlElement * | training_strategy_element | ) | [virtual] |
This method loads the members of this training strategy object from a XML element.
training_strategy_element | Pointer to a XML element of the TinyXML library. |
Definition at line 1328 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::save | ( | const std::string & | filename | ) | const |
This method saves to a XML-type file the members of the training algorithm object.
filename | Name of training algorithm XML-type file. |
Definition at line 1502 of file training_strategy.cpp.
void OpenNN::TrainingStrategy::load | ( | const std::string & | filename | ) |
This method loads a gradient descent object from a XML-type file. Please mind about the file format, wich is specified in the User's Guide.
filename | Name of training algorithm XML-type file. |
Definition at line 1528 of file training_strategy.cpp.
Pointer to an external performance functional object.
Definition at line 187 of file training_strategy.h.
Pointer to an internal training algorithm object to be used for initialization purposes.
Definition at line 191 of file training_strategy.h.
Pointer to an internal training algorithm object to be used for main training.
Definition at line 195 of file training_strategy.h.
Pointer to an internal training algorithm object to be used for refinement purposes.
Definition at line 199 of file training_strategy.h.
bool OpenNN::TrainingStrategy::initialization_training_algorithm_flag [protected] |
Flag for using or not the initialization training algorithm within the training strategy.
Definition at line 217 of file training_strategy.h.
bool OpenNN::TrainingStrategy::main_training_algorithm_flag [protected] |
Flag for using or not the main training algorithm within the training strategy.
Definition at line 221 of file training_strategy.h.
bool OpenNN::TrainingStrategy::refinement_training_algorithm_flag [protected] |
Flag for using or not the refinement training algorithm within the training strategy.
Definition at line 225 of file training_strategy.h.
bool OpenNN::TrainingStrategy::display [protected] |