GClasses

GClasses::GNeuroPCA Class Reference

This class is a generalization of PCA. When the bias is clamped, and the activation function is "identity", it is strictly equivalent to PCA. By default, however, the bias is allowed to drift from the mean, which gives better results. Also, by default, the activation function is "logistic", which enables it to find non-linear components in the data. (GUnsupervisedBackProp is a multi-layer generalization of this algorithm.) More...

#include <GManifold.h>

Inheritance diagram for GClasses::GNeuroPCA:
GClasses::GTransform

List of all members.

Public Member Functions

 GNeuroPCA (size_t targetDims, GRand *pRand)
virtual ~GNeuroPCA ()
GMatrixweights ()
 Returns the weight vectors.
void computeEigVals ()
 Specify to compute the eigenvalues during training. This method must be called before doIt is called.
double * eigVals ()
 Returns the eigenvalues. Returns NULL if computeEigVals was not called.
size_t targetDims ()
 Returns the number of principal components to find.
void clampBias ()
 Specify to not update the bias values.
void setActivation (GActivationFunction *pActivation)
 Sets the activation function. (Takes ownership of pActivation.)
virtual GMatrixdoit (GMatrix &in)
 See the comment for GTransform::doIt.

Protected Member Functions

void computeComponent (GMatrix *pIn, GMatrix *pOut, size_t col, GMatrix *pPreprocess)
double computeSumSquaredErr (GMatrix *pIn, GMatrix *pOut, size_t cols)

Protected Attributes

size_t m_targetDims
GMatrixm_pWeights
double * m_pEigVals
GRandm_pRand
GActivationFunctionm_pActivation
bool m_updateBias

Detailed Description

This class is a generalization of PCA. When the bias is clamped, and the activation function is "identity", it is strictly equivalent to PCA. By default, however, the bias is allowed to drift from the mean, which gives better results. Also, by default, the activation function is "logistic", which enables it to find non-linear components in the data. (GUnsupervisedBackProp is a multi-layer generalization of this algorithm.)


Constructor & Destructor Documentation

GClasses::GNeuroPCA::GNeuroPCA ( size_t  targetDims,
GRand pRand 
)
virtual GClasses::GNeuroPCA::~GNeuroPCA ( ) [virtual]

Member Function Documentation

void GClasses::GNeuroPCA::clampBias ( ) [inline]

Specify to not update the bias values.

void GClasses::GNeuroPCA::computeComponent ( GMatrix pIn,
GMatrix pOut,
size_t  col,
GMatrix pPreprocess 
) [protected]
void GClasses::GNeuroPCA::computeEigVals ( )

Specify to compute the eigenvalues during training. This method must be called before doIt is called.

double GClasses::GNeuroPCA::computeSumSquaredErr ( GMatrix pIn,
GMatrix pOut,
size_t  cols 
) [protected]
virtual GMatrix* GClasses::GNeuroPCA::doit ( GMatrix in) [virtual]

See the comment for GTransform::doIt.

Implements GClasses::GTransform.

double* GClasses::GNeuroPCA::eigVals ( ) [inline]

Returns the eigenvalues. Returns NULL if computeEigVals was not called.

void GClasses::GNeuroPCA::setActivation ( GActivationFunction pActivation)

Sets the activation function. (Takes ownership of pActivation.)

size_t GClasses::GNeuroPCA::targetDims ( ) [inline]

Returns the number of principal components to find.

GMatrix* GClasses::GNeuroPCA::weights ( ) [inline]

Returns the weight vectors.


Member Data Documentation

double* GClasses::GNeuroPCA::m_pEigVals [protected]