GClasses
GClasses::GRandomDirectionBinarySearch Class Reference

Detailed Description

This algorithm picks a random direction, then uses binary search to determine how far to step, and repeats.

#include <GHillClimber.h>

Inheritance diagram for GClasses::GRandomDirectionBinarySearch:
GClasses::GOptimizer

Public Member Functions

 GRandomDirectionBinarySearch (GTargetFunction *pTargetFunc, GRand *pRand)
 
virtual ~GRandomDirectionBinarySearch ()
 
virtual const GVeccurrentVector ()
 Returns the best vector yet found. More...
 
virtual double iterate ()
 Performs a little more optimization. (Call this in a loop until acceptable results are found.) 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...
 

Static Public Member Functions

static void test ()
 Performs unit testing. Throws an exception if any test fails. More...
 

Protected Attributes

GVec m_current
 
size_t m_dims
 
GVec m_direction
 
double m_err
 
GRandm_pRand
 
double m_stepSize
 
- Protected Attributes inherited from GClasses::GOptimizer
GTargetFunctionm_pCritic
 

Constructor & Destructor Documentation

GClasses::GRandomDirectionBinarySearch::GRandomDirectionBinarySearch ( GTargetFunction pTargetFunc,
GRand pRand 
)
virtual GClasses::GRandomDirectionBinarySearch::~GRandomDirectionBinarySearch ( )
virtual

Member Function Documentation

virtual const GVec& GClasses::GRandomDirectionBinarySearch::currentVector ( )
inlinevirtual

Returns the best vector yet found.

Implements GClasses::GOptimizer.

virtual double GClasses::GRandomDirectionBinarySearch::iterate ( )
virtual

Performs a little more optimization. (Call this in a loop until acceptable results are found.)

Implements GClasses::GOptimizer.

static void GClasses::GRandomDirectionBinarySearch::test ( )
static

Performs unit testing. Throws an exception if any test fails.

Member Data Documentation

GVec GClasses::GRandomDirectionBinarySearch::m_current
protected
size_t GClasses::GRandomDirectionBinarySearch::m_dims
protected
GVec GClasses::GRandomDirectionBinarySearch::m_direction
protected
double GClasses::GRandomDirectionBinarySearch::m_err
protected
GRand* GClasses::GRandomDirectionBinarySearch::m_pRand
protected
double GClasses::GRandomDirectionBinarySearch::m_stepSize
protected