GClasses
|
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. More...
#include <GOptimizer.h>
Public Member Functions | |
GOptimizer (GTargetFunction *pCritic) | |
virtual | ~GOptimizer () |
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.) | |
virtual double * | currentVector ()=0 |
Returns the current vector of the optimizer. In most cases, this is the best vector yet found. | |
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. | |
Protected Attributes | |
GTargetFunction * | m_pCritic |
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.
GClasses::GOptimizer::GOptimizer | ( | GTargetFunction * | pCritic | ) |
virtual GClasses::GOptimizer::~GOptimizer | ( | ) | [virtual] |
virtual double* GClasses::GOptimizer::currentVector | ( | ) | [pure virtual] |
Returns the current vector of the optimizer. In most cases, this is the best vector yet found.
Implemented in GClasses::GEvolutionaryOptimizer, GClasses::GMomentumGreedySearch, GClasses::GHillClimber, GClasses::GAnnealing, GClasses::GEmpiricalGradientDescent, GClasses::GSampleClimber, GClasses::GBruteForceSearch, GClasses::GRandomSearch, and GClasses::GProbeSearch.
virtual double GClasses::GOptimizer::iterate | ( | ) | [pure 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.)
Implemented in GClasses::GEvolutionaryOptimizer, GClasses::GMomentumGreedySearch, GClasses::GHillClimber, GClasses::GAnnealing, GClasses::GEmpiricalGradientDescent, GClasses::GSampleClimber, GClasses::GParticleSwarm, GClasses::GBruteForceSearch, GClasses::GRandomSearch, and GClasses::GProbeSearch.
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.
GTargetFunction* GClasses::GOptimizer::m_pCritic [protected] |