GClasses
GClasses::GGridSearch Class Reference

Detailed Description

This performs a brute-force grid search with uniform sampling over the unit hypercube with increasing granularity. (Your target function should scale the candidate vectors as necessary to cover the desired space.) This grid-search increases the granularity after each pass, and carefully avoids sampling anywhere that it has sampled before.

#include <GGridSearch.h>

Inheritance diagram for GClasses::GGridSearch:
GClasses::GOptimizer

Public Member Functions

 GGridSearch (GTargetFunction *pCritic)
 
virtual ~GGridSearch ()
 
virtual const GVeccurrentVector ()
 Returns the best vector yet found. More...
 
virtual double iterate ()
 Each pass will complete after ((2^n)+1)^d iterations. The distance between samples at that point will be 1/(2^n). After it completes n=30, it will begin repeating. More...
 
- Public Member Functions inherited from GClasses::GOptimizer
 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...
 
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

double m_bestError
 
GVec m_pBestVector
 
GVec m_pCandidate
 
GCoordVectorIteratorm_pCvi
 
- Protected Attributes inherited from GClasses::GOptimizer
GTargetFunctionm_pCritic
 

Constructor & Destructor Documentation

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

Member Function Documentation

virtual const GVec& GClasses::GGridSearch::currentVector ( )
virtual

Returns the best vector yet found.

Implements GClasses::GOptimizer.

virtual double GClasses::GGridSearch::iterate ( )
virtual

Each pass will complete after ((2^n)+1)^d iterations. The distance between samples at that point will be 1/(2^n). After it completes n=30, it will begin repeating.

Implements GClasses::GOptimizer.

Member Data Documentation

double GClasses::GGridSearch::m_bestError
protected
GVec GClasses::GGridSearch::m_pBestVector
protected
GVec GClasses::GGridSearch::m_pCandidate
protected
GCoordVectorIterator* GClasses::GGridSearch::m_pCvi
protected