GClasses
GClasses::GOptimizer Class Referenceabstract

Detailed Description

This is the base class of all search algorithms that can jump to any vector in the search space seek the vector that minimizes error.

#include <GOptimizer.h>

Inheritance diagram for GClasses::GOptimizer:
GClasses::GAnnealing GClasses::GBouncyBalls GClasses::GEmpiricalGradientDescent GClasses::GEvolutionaryOptimizer GClasses::GGridSearch GClasses::GHillClimber GClasses::GMinBinSearch GClasses::GMomentumGreedySearch GClasses::GParticleSwarm GClasses::GProbeSearch GClasses::GRandomDirectionBinarySearch GClasses::GRandomSearch GClasses::GSampleClimber

Public Member Functions

 GOptimizer (GTargetFunction *pCritic)
 
virtual ~GOptimizer ()
 
void basicTest (double minAccuracy, double warnRange=0.001)
 This is a helper method used by the unit tests of several model learners. More...
 
virtual const GVeccurrentVector ()=0
 Returns the current vector of the optimizer. For greedy search methods, this will be the best vector yet found. More...
 
virtual double iterate ()=0
 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...
 
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 Attributes

GTargetFunctionm_pCritic
 

Constructor & Destructor Documentation

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

Member Function Documentation

void GClasses::GOptimizer::basicTest ( double  minAccuracy,
double  warnRange = 0.001 
)

This is a helper method used by the unit tests of several model learners.

virtual const GVec& GClasses::GOptimizer::currentVector ( )
pure virtual
virtual double GClasses::GOptimizer::iterate ( )
pure virtual
double GClasses::GOptimizer::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.

Member Data Documentation

GTargetFunction* GClasses::GOptimizer::m_pCritic
protected