GClasses

GClasses::GWag Class Reference

This model trains several multi-layer perceptrons, then averages their weights together in an intelligent manner. More...

#include <GEnsemble.h>

Inheritance diagram for GClasses::GWag:
GClasses::GSupervisedLearner GClasses::GTransducer

List of all members.

Public Member Functions

 GWag (size_t size, GRand &rand)
 General-purpose constructor. size specifies the number of models to train and then average together.
 GWag (GDomNode *pNode, GLearnerLoader &ll)
 Deserializing constructor.
virtual ~GWag ()
virtual GDomNodeserialize (GDom *pDoc)
 Marshal this object into a DOM, which can then be converted to a variety of serial formats.
virtual void clear ()
 See the comment for GSupervisedLearner::clear.
GNeuralNetmodel ()
 Returns a pointer to the internal neural network. (You may use this method to specify training parameters before training, or to obtain the average neural network after training.)
void setModelCount (size_t n)
 Specify the number of neural networks to average together.

Protected Member Functions

virtual void trainInner (GMatrix &features, GMatrix &labels)
 See the comment for GSupervisedLearner::trainInner.
virtual void predictInner (const double *pIn, double *pOut)
 See the comment for GSupervisedLearner::predictInner.
virtual void predictDistributionInner (const double *pIn, GPrediction *pOut)
 See the comment for GSupervisedLearner::predictDistributionInner.
virtual bool canImplicitlyHandleNominalFeatures ()
 See the comment for GSupervisedLearner::canImplicitlyHandleNominalFeatures.
virtual bool canImplicitlyHandleNominalLabels ()
 See the comment for GSupervisedLearner::canImplicitlyHandleNominalLabels.

Protected Attributes

size_t m_models
GNeuralNetm_pNN

Detailed Description

This model trains several multi-layer perceptrons, then averages their weights together in an intelligent manner.


Constructor & Destructor Documentation

GClasses::GWag::GWag ( size_t  size,
GRand rand 
)

General-purpose constructor. size specifies the number of models to train and then average together.

GClasses::GWag::GWag ( GDomNode pNode,
GLearnerLoader ll 
)

Deserializing constructor.

virtual GClasses::GWag::~GWag ( ) [virtual]

Member Function Documentation

virtual bool GClasses::GWag::canImplicitlyHandleNominalFeatures ( ) [inline, protected, virtual]
virtual bool GClasses::GWag::canImplicitlyHandleNominalLabels ( ) [inline, protected, virtual]
virtual void GClasses::GWag::clear ( ) [virtual]

See the comment for GSupervisedLearner::clear.

Implements GClasses::GSupervisedLearner.

GNeuralNet* GClasses::GWag::model ( ) [inline]

Returns a pointer to the internal neural network. (You may use this method to specify training parameters before training, or to obtain the average neural network after training.)

virtual void GClasses::GWag::predictDistributionInner ( const double *  pIn,
GPrediction pOut 
) [protected, virtual]
virtual void GClasses::GWag::predictInner ( const double *  pIn,
double *  pOut 
) [protected, virtual]
virtual GDomNode* GClasses::GWag::serialize ( GDom pDoc) [virtual]

Marshal this object into a DOM, which can then be converted to a variety of serial formats.

Implements GClasses::GSupervisedLearner.

void GClasses::GWag::setModelCount ( size_t  n) [inline]

Specify the number of neural networks to average together.

virtual void GClasses::GWag::trainInner ( GMatrix features,
GMatrix labels 
) [protected, virtual]

Member Data Documentation

size_t GClasses::GWag::m_models [protected]