GClasses
GClasses::GNoiseGenerator Class Reference

Detailed Description

Just generates Gaussian noise.

#include <GTransform.h>

Inheritance diagram for GClasses::GNoiseGenerator:
GClasses::GIncrementalTransform GClasses::GTransform

Public Member Functions

 GNoiseGenerator ()
 
 GNoiseGenerator (const GDomNode *pNode)
 Load from a DOM. More...
 
virtual ~GNoiseGenerator ()
 
GRandrand ()
 Returns a reference to the rand object used to generate noise. More...
 
virtual GDomNodeserialize (GDom *pDoc) const
 Marshal this object into a DOM, which can then be converted to a variety of serial formats. More...
 
void setMeanAndDeviation (double m, double d)
 Sets the mean and deviation of the noise. More...
 
virtual void transform (const GVec &in, GVec &out)
 See the comment for GIncrementalTransform::transform. More...
 
virtual void untransform (const GVec &in, GVec &out)
 Throws an exception (because this transform cannot be reversed). More...
 
virtual void untransformToDistribution (const GVec &in, GPrediction *pOut)
 Throws an exception (because this transform cannot be undone). More...
 
- Public Member Functions inherited from GClasses::GIncrementalTransform
 GIncrementalTransform ()
 
 GIncrementalTransform (const GDomNode *pNode)
 
virtual ~GIncrementalTransform ()
 
const GRelationafter () const
 Returns a relation object describing the data after it is transformed. More...
 
const GRelationbefore () const
 Returns a relation object describing the data before it is transformed. More...
 
GVecinnerBuf ()
 Returns a buffer of sufficient size to store an inner (transformed) vector. The caller should not to delete the buffer. The same buffer will be returned each time. More...
 
virtual GMatrixreduce (const GMatrix &in)
 This calls train, then calls transformBatch, and returns the result. More...
 
void setAfter (GRelation *pRel)
 Sets the after relation. Takes ownership of pRel. More...
 
void setBefore (GRelation *pRel)
 Sets the before relation. Takes ownership of pRel. More...
 
void train (const GMatrix &data)
 Trains the transform on the data in pData. (This method may be a no-op for transformations that always behave in the same manner.) More...
 
void train (const GRelation &pRelation)
 "Trains" the transform without any data. More...
 
virtual GMatrixtransformBatch (const GMatrix &in)
 This assumes that train has already been called, and transforms all the rows in in returning the resulting matrix. The caller is responsible for deleting the new matrix. More...
 
virtual std::unique_ptr< GMatrixuntransformBatch (const GMatrix &in)
 This assumes train was previously called, and untransforms all the rows in pIn and returns the results. More...
 
- Public Member Functions inherited from GClasses::GTransform
 GTransform ()
 
 GTransform (const GDomNode *pNode)
 
virtual ~GTransform ()
 

Protected Member Functions

virtual GRelationtrainInner (const GMatrix &data)
 See the comment for GIncrementalTransform::train. More...
 
virtual GRelationtrainInner (const GRelation &relation)
 See the comment for GIncrementalTransform::train. More...
 
- Protected Member Functions inherited from GClasses::GIncrementalTransform
virtual GDomNodebaseDomNode (GDom *pDoc, const char *szClassName) const
 Child classes should use this in their implementation of serialize. More...
 

Protected Attributes

double m_deviation
 
double m_mean
 
GRand m_rand
 

Additional Inherited Members

- Static Public Member Functions inherited from GClasses::GIncrementalTransform
static void test ()
 Performs unit tests for this class. Throws an exception if there is a failure. More...
 

Constructor & Destructor Documentation

GClasses::GNoiseGenerator::GNoiseGenerator ( )
GClasses::GNoiseGenerator::GNoiseGenerator ( const GDomNode pNode)

Load from a DOM.

virtual GClasses::GNoiseGenerator::~GNoiseGenerator ( )
virtual

Member Function Documentation

GRand& GClasses::GNoiseGenerator::rand ( )
inline

Returns a reference to the rand object used to generate noise.

virtual GDomNode* GClasses::GNoiseGenerator::serialize ( GDom pDoc) const
virtual

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

Implements GClasses::GIncrementalTransform.

void GClasses::GNoiseGenerator::setMeanAndDeviation ( double  m,
double  d 
)
inline

Sets the mean and deviation of the noise.

virtual GRelation* GClasses::GNoiseGenerator::trainInner ( const GMatrix data)
protectedvirtual
virtual GRelation* GClasses::GNoiseGenerator::trainInner ( const GRelation relation)
protectedvirtual
virtual void GClasses::GNoiseGenerator::transform ( const GVec in,
GVec out 
)
virtual
virtual void GClasses::GNoiseGenerator::untransform ( const GVec in,
GVec out 
)
inlinevirtual

Throws an exception (because this transform cannot be reversed).

Implements GClasses::GIncrementalTransform.

virtual void GClasses::GNoiseGenerator::untransformToDistribution ( const GVec in,
GPrediction pOut 
)
inlinevirtual

Throws an exception (because this transform cannot be undone).

Implements GClasses::GIncrementalTransform.

Member Data Documentation

double GClasses::GNoiseGenerator::m_deviation
protected
double GClasses::GNoiseGenerator::m_mean
protected
GRand GClasses::GNoiseGenerator::m_rand
protected