GClasses
GClasses::GHillClimber Class Reference

#include <GHillClimber.h>

Inheritance diagram for GClasses::GHillClimber:
GClasses::GOptimizer

Public Member Functions

 GHillClimber (GTargetFunction *pCritic)
 
virtual ~GHillClimber ()
 
double anneal (double dev, GRand *pRand)
 You can call this method to simulate one annealing jump with the specified deviation in all dimensions. More...
 
double currentError ()
 Returns the error for the current vector. More...
 
virtual double * currentVector ()
 Returns a pointer to the current vector. More...
 
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.) More...
 
void setChangeFactor (double d)
 d should be a value between 0 and 1 More...
 
void setStepSizes (double size)
 Set all the current step sizes to this value. More...
 
double * stepSizes ()
 Returns the vector of step sizes. More...
 
- Public Member Functions inherited from GClasses::GOptimizer
 GOptimizer (GTargetFunction *pCritic)
 
virtual ~GOptimizer ()
 
double searchUntil (size_t nBurnInIterations, size_t nIterations, double dImprovement)
 This will first call iterate() nBurnInIterations times, then it will repeatedly call iterate() in blocks of nIterations times. If the error heuristic has not improved by the specified ratio after a block of iterations, it will stop. (For example, if the error before the block of iterations was 50, and the error after is 49, then training will stop if dImprovement is > 0.02.) If the error heuristic is not stable, then the value of nIterations should be large. More...
 

Protected Member Functions

void reset ()
 

Protected Attributes

double m_dChangeFactor
 
double m_dError
 
size_t m_nDims
 
double * m_pAnnealCand
 
double * m_pStepSizes
 
double * m_pVector
 
- Protected Attributes inherited from GClasses::GOptimizer
GTargetFunctionm_pCritic
 

Constructor & Destructor Documentation

GClasses::GHillClimber::GHillClimber ( GTargetFunction pCritic)
virtual GClasses::GHillClimber::~GHillClimber ( )
virtual

Member Function Documentation

double GClasses::GHillClimber::anneal ( double  dev,
GRand pRand 
)

You can call this method to simulate one annealing jump with the specified deviation in all dimensions.

double GClasses::GHillClimber::currentError ( )
inline

Returns the error for the current vector.

virtual double* GClasses::GHillClimber::currentVector ( )
inlinevirtual

Returns a pointer to the current vector.

Implements GClasses::GOptimizer.

virtual double GClasses::GHillClimber::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.

void GClasses::GHillClimber::reset ( )
protected
void GClasses::GHillClimber::setChangeFactor ( double  d)
inline

d should be a value between 0 and 1

void GClasses::GHillClimber::setStepSizes ( double  size)

Set all the current step sizes to this value.

double* GClasses::GHillClimber::stepSizes ( )

Returns the vector of step sizes.

Member Data Documentation

double GClasses::GHillClimber::m_dChangeFactor
protected
double GClasses::GHillClimber::m_dError
protected
size_t GClasses::GHillClimber::m_nDims
protected
double* GClasses::GHillClimber::m_pAnnealCand
protected
double* GClasses::GHillClimber::m_pStepSizes
protected
double* GClasses::GHillClimber::m_pVector
protected