GClasses
|
Uses an evolutionary process to optimize a vector.
#include <GEvolutionary.h>
Public Member Functions | |
GEvolutionaryOptimizer (GTargetFunction *pCritic, size_t population, GRand *pRand, double moreFitSurvivalRate) | |
moreFitSurvivalRate is the probability that the more fit member (in a tournament selection) survives More... | |
virtual | ~GEvolutionaryOptimizer () |
virtual const GVec & | currentVector () |
Returns the best vector found in recent iterations. More... | |
virtual double | iterate () |
Do a little bit more optimization. (This method is typically called in a loop until satisfactory results are obtained.) 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 Member Functions | |
size_t | doTournament () |
Returns the index of the tournament loser (who should typically die and be replaced). More... | |
GEvolutionaryOptimizerNode * | node (size_t index) |
void | recomputeError (size_t index, GEvolutionaryOptimizerNode *pNode, const GVec &vec) |
Protected Attributes | |
double | m_bestErr |
size_t | m_bestIndex |
std::vector< GEvolutionaryOptimizerNode * > | m_population |
GRand * | m_pRand |
double | m_tournamentProbability |
Protected Attributes inherited from GClasses::GOptimizer | |
GTargetFunction * | m_pCritic |
GClasses::GEvolutionaryOptimizer::GEvolutionaryOptimizer | ( | GTargetFunction * | pCritic, |
size_t | population, | ||
GRand * | pRand, | ||
double | moreFitSurvivalRate | ||
) |
moreFitSurvivalRate is the probability that the more fit member (in a tournament selection) survives
|
virtual |
|
virtual |
Returns the best vector found in recent iterations.
Implements GClasses::GOptimizer.
|
protected |
Returns the index of the tournament loser (who should typically die and be replaced).
|
virtual |
Do a little bit more optimization. (This method is typically called in a loop until satisfactory results are obtained.)
Implements GClasses::GOptimizer.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |