GClasses
|
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>
Public Member Functions | |
GNeuroPCA (size_t targetDims, GRand *pRand) | |
virtual | ~GNeuroPCA () |
GMatrix * | weights () |
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 GMatrix * | doit (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 |
GMatrix * | m_pWeights |
double * | m_pEigVals |
GRand * | m_pRand |
GActivationFunction * | m_pActivation |
bool | m_updateBias |
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.)
GClasses::GNeuroPCA::GNeuroPCA | ( | size_t | targetDims, |
GRand * | pRand | ||
) |
virtual GClasses::GNeuroPCA::~GNeuroPCA | ( | ) | [virtual] |
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] |
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.
GActivationFunction* GClasses::GNeuroPCA::m_pActivation [protected] |
double* GClasses::GNeuroPCA::m_pEigVals [protected] |
GRand* GClasses::GNeuroPCA::m_pRand [protected] |
GMatrix* GClasses::GNeuroPCA::m_pWeights [protected] |
size_t GClasses::GNeuroPCA::m_targetDims [protected] |
bool GClasses::GNeuroPCA::m_updateBias [protected] |