GClasses
|
This model trains several multi-layer perceptrons, then averages their weights together in an intelligent manner. More...
#include <GEnsemble.h>
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 GDomNode * | serialize (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. | |
GNeuralNet * | model () |
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 |
GNeuralNet * | m_pNN |
This model trains several multi-layer perceptrons, then averages their weights together in an intelligent manner.
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] |
virtual bool GClasses::GWag::canImplicitlyHandleNominalFeatures | ( | ) | [inline, protected, virtual] |
See the comment for GSupervisedLearner::canImplicitlyHandleNominalFeatures.
Reimplemented from GClasses::GTransducer.
virtual bool GClasses::GWag::canImplicitlyHandleNominalLabels | ( | ) | [inline, protected, virtual] |
See the comment for GSupervisedLearner::canImplicitlyHandleNominalLabels.
Reimplemented from GClasses::GTransducer.
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] |
See the comment for GSupervisedLearner::predictDistributionInner.
Implements GClasses::GSupervisedLearner.
virtual void GClasses::GWag::predictInner | ( | const double * | pIn, |
double * | pOut | ||
) | [protected, virtual] |
See the comment for GSupervisedLearner::predictInner.
Implements GClasses::GSupervisedLearner.
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] |
See the comment for GSupervisedLearner::trainInner.
Implements GClasses::GSupervisedLearner.
size_t GClasses::GWag::m_models [protected] |
GNeuralNet* GClasses::GWag::m_pNN [protected] |