GClasses
GClasses::GNeuralNetTargetFunction Class Reference

Detailed Description

A class that facilitates training a neural network with an arbitrary optimization algorithm.

#include <GNeuralNet.h>

Inheritance diagram for GClasses::GNeuralNetTargetFunction:
GClasses::GTargetFunction

Public Member Functions

 GNeuralNetTargetFunction (GNeuralNet &nn, const GMatrix &features, const GMatrix &labels)
 features and labels should be pre-filtered to contain only continuous values for the neural network. More...
 
virtual ~GNeuralNetTargetFunction ()
 
virtual double computeError (const GVec &pVector)
 Copies the vector into the neural network and measures sum-squared error. More...
 
virtual void initVector (GVec &pVector)
 Copies the neural network weights into the vector. More...
 
- Public Member Functions inherited from GClasses::GTargetFunction
 GTargetFunction (GRelation *pRelation)
 Takes ownership of pRelation. More...
 
 GTargetFunction (size_t dims)
 
virtual ~GTargetFunction ()
 
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

const GMatrixm_features
 
const GMatrixm_labels
 
GNeuralNetm_nn
 
- Protected Attributes inherited from GClasses::GTargetFunction
GRelationm_pRelation
 

Constructor & Destructor Documentation

GClasses::GNeuralNetTargetFunction::GNeuralNetTargetFunction ( GNeuralNet nn,
const GMatrix features,
const GMatrix labels 
)
inline

features and labels should be pre-filtered to contain only continuous values for the neural network.

virtual GClasses::GNeuralNetTargetFunction::~GNeuralNetTargetFunction ( )
inlinevirtual

Member Function Documentation

virtual double GClasses::GNeuralNetTargetFunction::computeError ( const GVec pVector)
inlinevirtual

Copies the vector into the neural network and measures sum-squared error.

Implements GClasses::GTargetFunction.

virtual void GClasses::GNeuralNetTargetFunction::initVector ( GVec pVector)
inlinevirtual

Copies the neural network weights into the vector.

Reimplemented from GClasses::GTargetFunction.

Member Data Documentation

const GMatrix& GClasses::GNeuralNetTargetFunction::m_features
protected
const GMatrix& GClasses::GNeuralNetTargetFunction::m_labels
protected
GNeuralNet& GClasses::GNeuralNetTargetFunction::m_nn
protected