GClasses
|
At each iteration this algorithm moves in only one dimension. If the situation doesn't improve it tries the opposite direction. If both directions are worse, it decreases the step size for that dimension, otherwise it increases the step size for that dimension. More...
#include <GHillClimber.h>
Public Member Functions | |
GMomentumGreedySearch (GTargetFunction *pCritic) | |
virtual | ~GMomentumGreedySearch () |
virtual double * | currentVector () |
Returns a pointer to the state vector. | |
void | setAllStepSizes (double dStepSize) |
Set all the current step sizes to this value. | |
double * | stepSizes () |
Returns the vector of step sizes. | |
virtual double | iterate () |
Makes another attempt to find a better vector. Returns the heuristic error. (Usually you will call this method in a loop until your stopping criteria has been met.) | |
void | setChangeFactor (double d) |
d should be a value between 0 and 1 | |
Protected Member Functions | |
void | reset () |
double | iterateOneDim () |
Protected Attributes | |
size_t | m_nDimensions |
size_t | m_nCurrentDim |
double * | m_pStepSizes |
double * | m_pVector |
double | m_dError |
double | m_dChangeFactor |
At each iteration this algorithm moves in only one dimension. If the situation doesn't improve it tries the opposite direction. If both directions are worse, it decreases the step size for that dimension, otherwise it increases the step size for that dimension.
GClasses::GMomentumGreedySearch::GMomentumGreedySearch | ( | GTargetFunction * | pCritic | ) |
virtual GClasses::GMomentumGreedySearch::~GMomentumGreedySearch | ( | ) | [virtual] |
virtual double* GClasses::GMomentumGreedySearch::currentVector | ( | ) | [inline, virtual] |
Returns a pointer to the state vector.
Implements GClasses::GOptimizer.
virtual double GClasses::GMomentumGreedySearch::iterate | ( | ) | [virtual] |
Makes another attempt to find a better vector. Returns the heuristic error. (Usually you will call this method in a loop until your stopping criteria has been met.)
Implements GClasses::GOptimizer.
double GClasses::GMomentumGreedySearch::iterateOneDim | ( | ) | [protected] |
void GClasses::GMomentumGreedySearch::reset | ( | ) | [protected] |
void GClasses::GMomentumGreedySearch::setAllStepSizes | ( | double | dStepSize | ) |
Set all the current step sizes to this value.
void GClasses::GMomentumGreedySearch::setChangeFactor | ( | double | d | ) | [inline] |
d should be a value between 0 and 1
double* GClasses::GMomentumGreedySearch::stepSizes | ( | ) |
Returns the vector of step sizes.
double GClasses::GMomentumGreedySearch::m_dChangeFactor [protected] |
double GClasses::GMomentumGreedySearch::m_dError [protected] |
size_t GClasses::GMomentumGreedySearch::m_nCurrentDim [protected] |
size_t GClasses::GMomentumGreedySearch::m_nDimensions [protected] |
double* GClasses::GMomentumGreedySearch::m_pStepSizes [protected] |
double* GClasses::GMomentumGreedySearch::m_pVector [protected] |