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 () |
void | clampBias () |
Specify to not update the bias values. More... | |
void | computeEigVals () |
Specify to compute the eigenvalues during training. This method must be called before reduce is called. More... | |
double * | eigVals () |
Returns the eigenvalues. Returns NULL if computeEigVals was not called. More... | |
virtual GMatrix * | reduce (const GMatrix &in) |
See the comment for GTransform::reduce. More... | |
void | setActivation (GActivationFunction *pActivation) |
Sets the activation function. (Takes ownership of pActivation.) More... | |
size_t | targetDims () |
Returns the number of principal components to find. More... | |
GMatrix * | weights () |
Returns the weight vectors. More... | |
![]() | |
GTransform () | |
GTransform (GDomNode *pNode, GLearnerLoader &ll) | |
virtual | ~GTransform () |
Protected Member Functions | |
void | computeComponent (const GMatrix *pIn, GMatrix *pOut, size_t col, GMatrix *pPreprocess) |
double | computeSumSquaredErr (const GMatrix *pIn, GMatrix *pOut, size_t cols) |
![]() | |
virtual GDomNode * | baseDomNode (GDom *pDoc, const char *szClassName) const |
Child classes should use this in their implementation of serialize. More... | |
Protected Attributes | |
GActivationFunction * | m_pActivation |
double * | m_pEigVals |
GRand * | m_pRand |
GMatrix * | m_pWeights |
size_t | m_targetDims |
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 |
|
inline |
Specify to not update the bias values.
|
protected |
void GClasses::GNeuroPCA::computeEigVals | ( | ) |
Specify to compute the eigenvalues during training. This method must be called before reduce is called.
|
protected |
|
inline |
Returns the eigenvalues. Returns NULL if computeEigVals was not called.
See the comment for GTransform::reduce.
Implements GClasses::GTransform.
void GClasses::GNeuroPCA::setActivation | ( | GActivationFunction * | pActivation | ) |
Sets the activation function. (Takes ownership of pActivation.)
|
inline |
Returns the number of principal components to find.
|
inline |
Returns the weight vectors.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |