Flood::GradientDescent Class Reference

#include <GradientDescent.h>

Inheritance diagram for Flood::GradientDescent:

Flood::TrainingAlgorithm

List of all members.

Public Member Functions

 GradientDescent (ObjectiveFunctional *)
 GradientDescent (void)
virtual ~GradientDescent (void)
void set_reserve_all_training_history (bool)
Vector< double > calculate_training_direction (const Vector< double > &)
void train (void)
void resize_training_history (int)
std::string get_training_history_XML (bool)
std::string to_XML (bool)
void load (const char *)


Detailed Description

This concrete class represents the gradient descent training algorithm for an objective functional of a multilayer perceptron.

Definition at line 29 of file GradientDescent.h.


Constructor & Destructor Documentation

Flood::GradientDescent::GradientDescent ( ObjectiveFunctional new_objective_functional_pointer  )  [explicit]

General constructor. It creates a gradient descent training algorithm object associated to an objective functional object. It also initializes the class members to their default values:

Training operators:

  • Training rate method = Brent;

Training parameters:

  • First training rate: 1.0.
  • Bracketing factor: 2.0.
  • Tolerance in training rate: 1.0e-3.

Stopping criteria:

  • Evaluation goal: -1.0e99.
  • Gradient norm goal: 0.0.
  • Maximum training time: 1.0e6.
  • Maximum number of epochs: 100.

User stuff:

  • Warning training rate: 1.0e6.
  • Error training rate: 1.0e12.
  • Display: true.
  • Display period: 25.

Parameters:
new_objective_functional_pointer Pointer to an objective functional object.

Definition at line 67 of file GradientDescent.cpp.

Flood::GradientDescent::GradientDescent ( void   )  [explicit]

Default constructor. It creates a gradient descent training algorithm object not associated to any objective functional object. It also initializes the class members to their default values:

Training operators:

  • Training rate method = Brent;

Training parameters:

  • First training rate: 1.0.
  • Bracketing factor: 2.0.
  • Tolerance in training rate: 1.0e-3.

Stopping criteria:

  • Evaluation goal: -1.0e99.
  • Gradient norm goal: 0.0.
  • Maximum training time: 1.0e6.
  • Maximum number of epochs: 100.

User stuff:

  • Warning training rate: 1.0e6.
  • Error training rate: 1.0e12.
  • Display: true.
  • Display period: 25.

Definition at line 107 of file GradientDescent.cpp.

Flood::GradientDescent::~GradientDescent ( void   )  [virtual]

Destructor.

Definition at line 116 of file GradientDescent.cpp.


Member Function Documentation

std::string Flood::GradientDescent::get_training_history_XML ( bool  show_declaration  )  [virtual]

This method returns a string with the history of the training process in XML-type format. Only that training history variables which have been reserved are included here.

Parameters:
show_declaration True if an XML-type declaration is to be included at the beginning.

Reimplemented from Flood::TrainingAlgorithm.

Definition at line 647 of file GradientDescent.cpp.

void Flood::GradientDescent::load ( const char *  filename  )  [virtual]

This method loads a conjugate gradient object from an XML-type file. Please mind about the file format, wich is specified in the User's Guide.

Parameters:
filename Name of conjugate gradient XML-type.

Reimplemented from Flood::TrainingAlgorithm.

Definition at line 730 of file GradientDescent.cpp.

void Flood::GradientDescent::resize_training_history ( int  new_size  )  [virtual]

This method resizes the vectors or matrices containing training history information to a new size:

  • Elapsed time history vector.
  • Free parameters history matrix.
  • Free parameters norm history vector.
  • Evaluation history vector.
  • Gradient history matrix.
  • Gradient norm history vector.
  • Training direction history matrix.
  • Training direction norm history vector
  • Training rate history vector.

Parameters:
new_size Size of training history.

Reimplemented from Flood::TrainingAlgorithm.

Definition at line 1270 of file GradientDescent.cpp.

void Flood::GradientDescent::set_reserve_all_training_history ( bool  new_reserve_all_training_history  )  [virtual]

This method makes the training history of all variables to reseved or not in memory:

  • Parameters.
  • Parameters norm.
  • Evaluation.
  • Gradient.
  • Gradient norm.
  • Validation error.
  • Training direction.
  • Training direction norm.
  • Training rate.
Parameters:
new_reserve_all_training_history True if the training history of all variables is to be reserved, false otherwise.

Reimplemented from Flood::TrainingAlgorithm.

Definition at line 139 of file GradientDescent.cpp.

std::string Flood::GradientDescent::to_XML ( bool  show_declaration  )  [virtual]

This method prints to the screen the training parameters, the stopping criteria and other user stuff concerning the gradient descent object.

Parameters:
show_declaration True if a XML-type declaration is wanted, false otherwise.

Reimplemented from Flood::TrainingAlgorithm.

Definition at line 514 of file GradientDescent.cpp.

void Flood::GradientDescent::train ( void   )  [virtual]

This method trains a multilayer perceptron with an associated objective functional according to the gradient descent algorithm. Training occurs according to the training operators, training parameters and stopping criteria.

Implements Flood::TrainingAlgorithm.

Definition at line 180 of file GradientDescent.cpp.


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

Generated on Fri Jul 30 09:51:58 2010 for Flood by  doxygen 1.5.9