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::GManifoldLearner GClasses::GTransform

List of all members.

Public Member Functions

 GUnsupervisedBackProp (size_t intrinsicDims, GRand *pRand)
 GUnsupervisedBackProp (GDomNode *pNode, GLearnerLoader &ll)
virtual ~GUnsupervisedBackProp ()
GDomNodeserialize (GDom *pDoc)
 Marshall this object to a DOM that can be serialized.
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 doit.
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 doit is called. (You can pass NULL to this method to discard the current model, so that a new model will be trained next time doit is called.)
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.
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 "doit", then the intrinsic variables will be initialized with small random values.
virtual GMatrixdoit (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).
void setUseInputBias (bool b)
 Specify whether to use one of the input values as a bias.
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.
GImageJittererjitterer ()
 Returns the current image jitterer.
void hiToLow (const double *pIn, double *pOut)
 Given a high-dimensional vector, computes and returns a corresponding low-dimensional vector.
void lowToHi (const double *pIn, double *pOut)
 Given a low-dimensional vector, computes and returns the corresponding high-dimensional vector.
double * mins ()
double * ranges ()
void useJitterer ()
GMatrixprogress ()
void trackProgress ()
size_t featureDims ()
size_t labelDims ()

Protected Attributes

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

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

virtual GMatrix* GClasses::GUnsupervisedBackProp::doit ( 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.

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 doit.

GMatrix& GClasses::GUnsupervisedBackProp::progress ( ) [inline]
double* GClasses::GUnsupervisedBackProp::ranges ( )
GDomNode* GClasses::GUnsupervisedBackProp::serialize ( GDom pDoc)

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 "doit", 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 doit is called. (You can pass NULL to this method to discard the current model, so that a new model will be trained next time doit 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