GClasses
GClasses::GTargetFunction Class Referenceabstract

Detailed Description

The optimizer seeks to find values that minimize this target function.

#include <GOptimizer.h>

Inheritance diagram for GClasses::GTargetFunction:
GClasses::GNeuralNetTargetFunction GClasses::GOptimizerBasicTestTargetFunction GClasses::OptimizerTargetFunc

Public Member Functions

 GTargetFunction (GRelation *pRelation)
 Takes ownership of pRelation. More...
 
 GTargetFunction (size_t dims)
 
virtual ~GTargetFunction ()
 
virtual double computeError (const GVec &vector)=0
 Computes the error of the given vector using all patterns. More...
 
virtual void initVector (GVec &vector)
 Sets pVector to an initial guess. The default behavior is to initialize the vector to all zeros. You should override this method if different behavior is desired. More...
 
virtual bool isStable ()
 This method should return true if computeError is deterministic with respect to the vector being optimized. It should return false if the error depends on some state other than the vector being optimized. This mostly affects whether the optimization algorithms are permitted to remember old error values for efficiency purposes. Stable is assumed, so you should override this method if your target function is not stable. More...
 
GRelationrelation ()
 Returns a (smart) pointer to the relation, which specifies the type (discrete or real) of each element in the vector that is being optimized. More...
 

Protected Attributes

GRelationm_pRelation
 

Constructor & Destructor Documentation

GClasses::GTargetFunction::GTargetFunction ( GRelation pRelation)
inline

Takes ownership of pRelation.

GClasses::GTargetFunction::GTargetFunction ( size_t  dims)
virtual GClasses::GTargetFunction::~GTargetFunction ( )
virtual

Member Function Documentation

virtual double GClasses::GTargetFunction::computeError ( const GVec vector)
pure virtual

Computes the error of the given vector using all patterns.

Implemented in GClasses::GNeuralNetTargetFunction, GClasses::GOptimizerBasicTestTargetFunction, and GClasses::OptimizerTargetFunc.

virtual void GClasses::GTargetFunction::initVector ( GVec vector)
virtual

Sets pVector to an initial guess. The default behavior is to initialize the vector to all zeros. You should override this method if different behavior is desired.

Reimplemented in GClasses::GNeuralNetTargetFunction, and GClasses::OptimizerTargetFunc.

virtual bool GClasses::GTargetFunction::isStable ( )
inlinevirtual

This method should return true if computeError is deterministic with respect to the vector being optimized. It should return false if the error depends on some state other than the vector being optimized. This mostly affects whether the optimization algorithms are permitted to remember old error values for efficiency purposes. Stable is assumed, so you should override this method if your target function is not stable.

Reimplemented in GClasses::OptimizerTargetFunc.

GRelation* GClasses::GTargetFunction::relation ( )
inline

Returns a (smart) pointer to the relation, which specifies the type (discrete or real) of each element in the vector that is being optimized.

Member Data Documentation

GRelation* GClasses::GTargetFunction::m_pRelation
protected