GClasses
GClasses::GUnsupervisedBackProp Class Reference

A manifold learning algorithm that uses back-propagation to train a neural net model to map from low-dimensional space to high-dimensional space. More...

#include <GManifold.h>

Inheritance diagram for GClasses::GUnsupervisedBackProp:
GClasses::GTransform

Public Member Functions

 GUnsupervisedBackProp (size_t intrinsicDims, GRand *pRand)
 
 GUnsupervisedBackProp (GDomNode *pNode, GLearnerLoader &ll)
 
virtual ~GUnsupervisedBackProp ()
 
size_t featureDims ()
 
void hiToLow (const double *pIn, double *pOut)
 Given a high-dimensional vector, computes and returns a corresponding low-dimensional vector. More...
 
GImageJittererjitterer ()
 Returns the current image jitterer. More...
 
size_t labelDims ()
 
void lowToHi (const double *pIn, double *pOut)
 Given a low-dimensional vector, computes and returns the corresponding high-dimensional vector. More...
 
double * mins ()
 
GNeuralNetneuralNet ()
 Returns a pointer to the neural network used to model the manifold. Typically, this is used to add layers to the neural network, or set the learning rate (etc.) before calling reduce. (You must add at least one layer.) More...
 
void onePass ()
 Use only single-pass training. More...
 
GMatrixprogress ()
 
double * ranges ()
 
virtual GMatrixreduce (const GMatrix &in)
 Perform NLDR. (This also trains the internal neural network to map from low-dimensional space to high-dimensional space.) Returns a pointer to the intrinsic values (which you are responsible to delete). More...
 
GDomNodeserialize (GDom *pDoc) const
 Marshall this object to a DOM that can be serialized. More...
 
void setIntrinsic (GMatrix *pIntrinsic)
 Specify initial values for the intrinsic variables. This method takes ownership of pIntrinsic. If this method is not called prior to "reduce", then the intrinsic variables will be initialized with small random values. More...
 
void setJitterer (GImageJitterer *pJitterer)
 Takes ownership of pJitterer. Specify an image jitterer to use during training to make it robust to rotation, translation, and scale. If an image jitterer is used, then there must be exactly two dimensional parameters, and the parameters used to construct the image jitterer must be consistent with those used to construct this object. More...
 
void setNeuralNet (GNeuralNet *pNN)
 Takes ownership of pNN. Replaces the internal neural net with the one specified. This method assumes that pNN has already been trained. If m_updateWeights is true, then it will further-refinde this model when reduce is called. (You can pass NULL to this method to discard the current model, so that a new model will be trained next time reduce is called.) More...
 
void setParams (std::vector< size_t > &paramRanges)
 Parameterize the output values. This feature is typically used when the output is an image, and the width and height are specified for the paramRanges. More...
 
void setUseInputBias (bool b)
 Specify whether to use one of the input values as a bias. More...
 
void trackProgress ()
 
void useJitterer ()
 
- Public Member Functions inherited from GClasses::GTransform
 GTransform ()
 
 GTransform (GDomNode *pNode, GLearnerLoader &ll)
 
virtual ~GTransform ()
 

Protected Attributes

GCoordVectorIterator m_cvi
 
size_t m_intrinsicDims
 
size_t m_jitterDims
 
bool m_onePass
 
size_t m_paramDims
 
GMatrixm_pIntrinsic
 
GImageJittererm_pJitterer
 
double * m_pMins
 
GNeuralNetm_pNN
 
size_t * m_pParamRanges
 
GMatrixm_pProgress
 
double * m_pRanges
 
bool m_useInputBias
 

Additional Inherited Members

- Protected Member Functions inherited from GClasses::GTransform
virtual GDomNodebaseDomNode (GDom *pDoc, const char *szClassName) const
 Child classes should use this in their implementation of serialize. More...
 

Detailed Description

A manifold learning algorithm that uses back-propagation to train a neural net model to map from low-dimensional space to high-dimensional space.

Constructor & Destructor Documentation

GClasses::GUnsupervisedBackProp::GUnsupervisedBackProp ( size_t  intrinsicDims,
GRand pRand 
)
GClasses::GUnsupervisedBackProp::GUnsupervisedBackProp ( GDomNode pNode,
GLearnerLoader ll 
)
virtual GClasses::GUnsupervisedBackProp::~GUnsupervisedBackProp ( )
virtual

Member Function Documentation

size_t GClasses::GUnsupervisedBackProp::featureDims ( )
inline
void GClasses::GUnsupervisedBackProp::hiToLow ( const double *  pIn,
double *  pOut 
)

Given a high-dimensional vector, computes and returns a corresponding low-dimensional vector.

GImageJitterer* GClasses::GUnsupervisedBackProp::jitterer ( )
inline

Returns the current image jitterer.

size_t GClasses::GUnsupervisedBackProp::labelDims ( )
void GClasses::GUnsupervisedBackProp::lowToHi ( const double *  pIn,
double *  pOut 
)

Given a low-dimensional vector, computes and returns the corresponding high-dimensional vector.

double* GClasses::GUnsupervisedBackProp::mins ( )
GNeuralNet* GClasses::GUnsupervisedBackProp::neuralNet ( )
inline

Returns a pointer to the neural network used to model the manifold. Typically, this is used to add layers to the neural network, or set the learning rate (etc.) before calling reduce. (You must add at least one layer.)

void GClasses::GUnsupervisedBackProp::onePass ( )
inline

Use only single-pass training.

GMatrix& GClasses::GUnsupervisedBackProp::progress ( )
inline
double* GClasses::GUnsupervisedBackProp::ranges ( )
virtual GMatrix* GClasses::GUnsupervisedBackProp::reduce ( const GMatrix in)
virtual

Perform NLDR. (This also trains the internal neural network to map from low-dimensional space to high-dimensional space.) Returns a pointer to the intrinsic values (which you are responsible to delete).

Implements GClasses::GTransform.

GDomNode* GClasses::GUnsupervisedBackProp::serialize ( GDom pDoc) const

Marshall this object to a DOM that can be serialized.

void GClasses::GUnsupervisedBackProp::setIntrinsic ( GMatrix pIntrinsic)

Specify initial values for the intrinsic variables. This method takes ownership of pIntrinsic. If this method is not called prior to "reduce", then the intrinsic variables will be initialized with small random values.

void GClasses::GUnsupervisedBackProp::setJitterer ( GImageJitterer pJitterer)

Takes ownership of pJitterer. Specify an image jitterer to use during training to make it robust to rotation, translation, and scale. If an image jitterer is used, then there must be exactly two dimensional parameters, and the parameters used to construct the image jitterer must be consistent with those used to construct this object.

void GClasses::GUnsupervisedBackProp::setNeuralNet ( GNeuralNet pNN)

Takes ownership of pNN. Replaces the internal neural net with the one specified. This method assumes that pNN has already been trained. If m_updateWeights is true, then it will further-refinde this model when reduce is called. (You can pass NULL to this method to discard the current model, so that a new model will be trained next time reduce is called.)

void GClasses::GUnsupervisedBackProp::setParams ( std::vector< size_t > &  paramRanges)

Parameterize the output values. This feature is typically used when the output is an image, and the width and height are specified for the paramRanges.

void GClasses::GUnsupervisedBackProp::setUseInputBias ( bool  b)
inline

Specify whether to use one of the input values as a bias.

void GClasses::GUnsupervisedBackProp::trackProgress ( )
void GClasses::GUnsupervisedBackProp::useJitterer ( )
inline

Member Data Documentation

GCoordVectorIterator GClasses::GUnsupervisedBackProp::m_cvi
protected
size_t GClasses::GUnsupervisedBackProp::m_intrinsicDims
protected
size_t GClasses::GUnsupervisedBackProp::m_jitterDims
protected
bool GClasses::GUnsupervisedBackProp::m_onePass
protected
size_t GClasses::GUnsupervisedBackProp::m_paramDims
protected
GMatrix* GClasses::GUnsupervisedBackProp::m_pIntrinsic
protected
GImageJitterer* GClasses::GUnsupervisedBackProp::m_pJitterer
protected
double* GClasses::GUnsupervisedBackProp::m_pMins
protected
GNeuralNet* GClasses::GUnsupervisedBackProp::m_pNN
protected
size_t* GClasses::GUnsupervisedBackProp::m_pParamRanges
protected
GMatrix* GClasses::GUnsupervisedBackProp::m_pProgress
protected
double* GClasses::GUnsupervisedBackProp::m_pRanges
protected
bool GClasses::GUnsupervisedBackProp::m_useInputBias
protected