GClasses
|
This algorithm does a gradient descent by feeling a small distance out in each dimension to measure the gradient. For efficiency reasons, it only measures the gradient in one dimension (which it cycles round-robin style) per iteration and uses the remembered gradient in the other dimensions. More...
#include <GHillClimber.h>
Public Member Functions | |
GEmpiricalGradientDescent (GTargetFunction *pCritic, GRand *pRand) | |
virtual | ~GEmpiricalGradientDescent () |
virtual double * | currentVector () |
Returns the best vector yet found. | |
virtual double | iterate () |
Performs a little more optimization. (Call this in a loop until acceptable results are found.) | |
void | setLearningRate (double d) |
Sets the learning rate. | |
void | setMomentum (double d) |
Sets the momentum value. | |
Protected Member Functions | |
void | reset () |
Protected Attributes | |
double | m_dLearningRate |
size_t | m_nDimensions |
double * | m_pVector |
double * | m_pGradient |
double * | m_pDelta |
double | m_dFeelDistance |
double | m_dMomentum |
GRand * | m_pRand |
This algorithm does a gradient descent by feeling a small distance out in each dimension to measure the gradient. For efficiency reasons, it only measures the gradient in one dimension (which it cycles round-robin style) per iteration and uses the remembered gradient in the other dimensions.
GClasses::GEmpiricalGradientDescent::GEmpiricalGradientDescent | ( | GTargetFunction * | pCritic, |
GRand * | pRand | ||
) |
virtual GClasses::GEmpiricalGradientDescent::~GEmpiricalGradientDescent | ( | ) | [virtual] |
virtual double* GClasses::GEmpiricalGradientDescent::currentVector | ( | ) | [inline, virtual] |
Returns the best vector yet found.
Implements GClasses::GOptimizer.
virtual double GClasses::GEmpiricalGradientDescent::iterate | ( | ) | [virtual] |
Performs a little more optimization. (Call this in a loop until acceptable results are found.)
Implements GClasses::GOptimizer.
void GClasses::GEmpiricalGradientDescent::reset | ( | ) | [protected] |
void GClasses::GEmpiricalGradientDescent::setLearningRate | ( | double | d | ) | [inline] |
Sets the learning rate.
void GClasses::GEmpiricalGradientDescent::setMomentum | ( | double | d | ) | [inline] |
Sets the momentum value.
double GClasses::GEmpiricalGradientDescent::m_dFeelDistance [protected] |
double GClasses::GEmpiricalGradientDescent::m_dLearningRate [protected] |
double GClasses::GEmpiricalGradientDescent::m_dMomentum [protected] |
size_t GClasses::GEmpiricalGradientDescent::m_nDimensions [protected] |
double* GClasses::GEmpiricalGradientDescent::m_pDelta [protected] |
double* GClasses::GEmpiricalGradientDescent::m_pGradient [protected] |
GRand* GClasses::GEmpiricalGradientDescent::m_pRand [protected] |
double* GClasses::GEmpiricalGradientDescent::m_pVector [protected] |