OpenNN::TrainingAlgorithm Class Reference

#include <training_algorithm.h>

Inheritance diagram for OpenNN::TrainingAlgorithm:

OpenNN::ConjugateGradient OpenNN::EvolutionaryAlgorithm OpenNN::GradientDescent OpenNN::LevenbergMarquardtAlgorithm OpenNN::NewtonMethod OpenNN::QuasiNewtonMethod OpenNN::RandomSearch

List of all members.

Classes

struct  Results

Public Member Functions

 TrainingAlgorithm (void)
 TrainingAlgorithm (PerformanceFunctional *)
 TrainingAlgorithm (TiXmlElement *)
virtual ~TrainingAlgorithm (void)
PerformanceFunctionalget_performance_functional_pointer (void) const
const bool & get_display (void) const
void set (void)
void set (PerformanceFunctional *)
virtual void set_default (void)
void set_performance_functional_pointer (PerformanceFunctional *)
void set_display (const bool &)
virtual void check (void) const
virtual Resultsperform_training (void)=0
virtual std::string write_training_algorithm_type (void) const
virtual std::string to_string (void) const
void print (void) const
virtual TiXmlElement * to_XML (void) const
virtual void from_XML (TiXmlElement *)
void save (const std::string &) const
void load (const std::string &)

Protected Attributes

PerformanceFunctionalperformance_functional_pointer
bool display


Detailed Description

This abstract class represents the concept of training algorithm for a neural network. Any derived class must implement the perform_training(void) method.

Definition at line 33 of file training_algorithm.h.


Constructor & Destructor Documentation

OpenNN::TrainingAlgorithm::TrainingAlgorithm ( void   )  [explicit]

Default constructor. It creates a training algorithm object not associated to any performance functional object.

Definition at line 47 of file training_algorithm.cpp.

OpenNN::TrainingAlgorithm::TrainingAlgorithm ( PerformanceFunctional new_performance_functional_pointer  )  [explicit]

General constructor. It creates a training algorithm object associated to a performance functional object.

Parameters:
new_performance_functional_pointer Pointer to a performance functional object.

Definition at line 60 of file training_algorithm.cpp.

OpenNN::TrainingAlgorithm::TrainingAlgorithm ( TiXmlElement *  training_algorithm_element  )  [explicit]

XML constructor. It creates a training algorithm object not associated to any performance functional object. It also loads the other members from a XML element.

Definition at line 73 of file training_algorithm.cpp.

OpenNN::TrainingAlgorithm::~TrainingAlgorithm ( void   )  [virtual]

Destructor.

Definition at line 84 of file training_algorithm.cpp.


Member Function Documentation

PerformanceFunctional * OpenNN::TrainingAlgorithm::get_performance_functional_pointer ( void   )  const

This method returns a pointer to the performance functional object to which the training algorithm is associated.

Definition at line 96 of file training_algorithm.cpp.

const bool & OpenNN::TrainingAlgorithm::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 107 of file training_algorithm.cpp.

void OpenNN::TrainingAlgorithm::set ( void   ) 

This method sets the performance functional pointer to NULL. It also sets the rest of members to their default values.

Reimplemented in OpenNN::EvolutionaryAlgorithm.

Definition at line 118 of file training_algorithm.cpp.

void OpenNN::TrainingAlgorithm::set ( PerformanceFunctional new_performance_functional_pointer  ) 

This method sets a new performance functional pointer. It also sets the rest of members to their default values.

Parameters:
new_performance_functional_pointer Pointer to a performance functional object.

Reimplemented in OpenNN::EvolutionaryAlgorithm.

Definition at line 132 of file training_algorithm.cpp.

void OpenNN::TrainingAlgorithm::set_default ( void   )  [virtual]

This method sets the members of the training algorithm object to their default values.

Reimplemented in OpenNN::ConjugateGradient, OpenNN::EvolutionaryAlgorithm, OpenNN::GradientDescent, OpenNN::LevenbergMarquardtAlgorithm, OpenNN::NewtonMethod, OpenNN::QuasiNewtonMethod, and OpenNN::RandomSearch.

Definition at line 168 of file training_algorithm.cpp.

void OpenNN::TrainingAlgorithm::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 algorithm.

Parameters:
new_performance_functional_pointer Pointer to a performance functional object.

Definition at line 145 of file training_algorithm.cpp.

void OpenNN::TrainingAlgorithm::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.

Parameters:
new_display Display value.

Definition at line 158 of file training_algorithm.cpp.

void OpenNN::TrainingAlgorithm::check ( void   )  const [virtual]

This method performs a default checking for training algorithms. In particular, it checks that the performance functional pointer associated to the training algorithm is not NULL, and that the neural network associated to that performance functional is neither NULL. If that checkings are not hold, an exception is thrown.

Reimplemented in OpenNN::LevenbergMarquardtAlgorithm.

Definition at line 191 of file training_algorithm.cpp.

virtual Results* OpenNN::TrainingAlgorithm::perform_training ( void   )  [pure virtual]

std::string OpenNN::TrainingAlgorithm::write_training_algorithm_type ( void   )  const [virtual]

std::string OpenNN::TrainingAlgorithm::to_string ( void   )  const [virtual]

This method returns a default string representation of a training algorithm.

Definition at line 221 of file training_algorithm.cpp.

void OpenNN::TrainingAlgorithm::print ( void   )  const

This method prints to the screen the XML-type representation of the training algorithm object.

Definition at line 293 of file training_algorithm.cpp.

TiXmlElement * OpenNN::TrainingAlgorithm::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.

Reimplemented in OpenNN::ConjugateGradient, OpenNN::EvolutionaryAlgorithm, OpenNN::GradientDescent, OpenNN::LevenbergMarquardtAlgorithm, OpenNN::NewtonMethod, OpenNN::QuasiNewtonMethod, and OpenNN::RandomSearch.

Definition at line 237 of file training_algorithm.cpp.

void OpenNN::TrainingAlgorithm::from_XML ( TiXmlElement *  training_algorithm_element  )  [virtual]

This method loads a training algorithm object from a XML element.

Parameters:
training_algorithm_element Pointer to a Tiny XML element containing the training algorithm members.

Reimplemented in OpenNN::ConjugateGradient, OpenNN::EvolutionaryAlgorithm, OpenNN::GradientDescent, OpenNN::LevenbergMarquardtAlgorithm, OpenNN::NewtonMethod, OpenNN::QuasiNewtonMethod, and OpenNN::RandomSearch.

Definition at line 267 of file training_algorithm.cpp.

void OpenNN::TrainingAlgorithm::save ( const std::string &  filename  )  const

This method saves to a XML-type file the members of the training algorithm object.

Parameters:
filename Name of training algorithm XML-type file.

Definition at line 304 of file training_algorithm.cpp.

void OpenNN::TrainingAlgorithm::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.

Parameters:
filename Name of training algorithm XML-type file.

Definition at line 330 of file training_algorithm.cpp.


Member Data Documentation

Pointer to a performance functional for a multilayer perceptron object.

Definition at line 119 of file training_algorithm.h.

Display messages to screen.

Definition at line 125 of file training_algorithm.h.


The documentation for this class was generated from the following files:

Generated on Sun Aug 26 11:58:21 2012 for OpenNN by  doxygen 1.5.9