GClasses
|
This is a nonlinear dimensionality reduction algorithm loosely inspired by Maximum Variance Unfolding. It iteratively scales up the data, then restores distances between neighbors.
#include <GManifold.h>
Public Member Functions | |
GScalingUnfolder () | |
GScalingUnfolder (GDomNode *pNode) | |
virtual | ~GScalingUnfolder () |
GRand & | rand () |
Returns a reference to the pseudo-random number generator used by this object. More... | |
virtual GMatrix * | reduce (const GMatrix &in) |
Reduces the dimensionality of "in". More... | |
void | setNeighborCount (size_t n) |
Specify the number of neighbors to use. (The default is 14.) More... | |
void | setPasses (size_t n) |
Specify the number of times to 'scale the data then recover local relationships'. More... | |
void | setRefinesPerScale (size_t n) |
Specify the number of times to refine the points after each scaling. More... | |
void | setScaleRate (double d) |
Specify the scaling rate. The default is 0.9. More... | |
void | setTargetDims (size_t n) |
Specify the number of dimensions in the output results. More... | |
void | unfold (GMatrix &intrinsic, GNeighborGraph &nf, size_t encoderTrainIters=0, GNeuralNetLearner *pEncoder=NULL, GNeuralNetLearner *pDecoder=NULL, const GMatrix *pVisible=NULL) |
Unfolds the points in intrinsic, such that distances specified in nf are preserved. If pVisible is non-NULL, then pEncoder will be incrementally trained to encode pVisible to intrinsic. More... | |
Public Member Functions inherited from GClasses::GTransform | |
GTransform () | |
GTransform (const GDomNode *pNode) | |
virtual | ~GTransform () |
Static Public Member Functions | |
static void | restore_local_distances_pass (GMatrix &intrinsic, GNeighborGraph &ng, size_t neighborCount, GRand &rand) |
Perform a single pass over all the edges and attempt to restore local relationships. More... | |
static size_t | unfold_iter (GMatrix &intrinsic, GRand &rand, size_t neighborCount=12, double scaleFactor=1.01, size_t refinements=100) |
A convenience method for iteratively unfolding the manifold sampled by a matrix. (This method is not used within this class.) It finds the k-nearest neighbors within the matrix. (If the neighbor-graph is not connected, it doubles k until it is connected.) Next, this method multiplies the matrix by scaleFactor. Finally, it refines the points to restore local distances. (It would not typically be efficient to call this in a tight loop, because that would perform the neighbor-finding step each time.) Returns the number of neighbors actually used to find a connected graph. More... | |
Protected Attributes | |
size_t | m_neighborCount |
size_t | m_passes |
GRand | m_rand |
size_t | m_refines_per_scale |
double | m_scaleRate |
size_t | m_targetDims |
Additional Inherited Members | |
Protected Member Functions inherited from GClasses::GTransform | |
virtual GDomNode * | baseDomNode (GDom *pDoc, const char *szClassName) const |
Child classes should use this in their implementation of serialize. More... | |
GClasses::GScalingUnfolder::GScalingUnfolder | ( | ) |
GClasses::GScalingUnfolder::GScalingUnfolder | ( | GDomNode * | pNode | ) |
|
virtual |
|
inline |
Returns a reference to the pseudo-random number generator used by this object.
Reduces the dimensionality of "in".
Implements GClasses::GTransform.
|
static |
Perform a single pass over all the edges and attempt to restore local relationships.
|
inline |
Specify the number of neighbors to use. (The default is 14.)
|
inline |
Specify the number of times to 'scale the data then recover local relationships'.
|
inline |
Specify the number of times to refine the points after each scaling.
|
inline |
Specify the scaling rate. The default is 0.9.
|
inline |
Specify the number of dimensions in the output results.
void GClasses::GScalingUnfolder::unfold | ( | GMatrix & | intrinsic, |
GNeighborGraph & | nf, | ||
size_t | encoderTrainIters = 0 , |
||
GNeuralNetLearner * | pEncoder = NULL , |
||
GNeuralNetLearner * | pDecoder = NULL , |
||
const GMatrix * | pVisible = NULL |
||
) |
Unfolds the points in intrinsic, such that distances specified in nf are preserved. If pVisible is non-NULL, then pEncoder will be incrementally trained to encode pVisible to intrinsic.
|
static |
A convenience method for iteratively unfolding the manifold sampled by a matrix. (This method is not used within this class.) It finds the k-nearest neighbors within the matrix. (If the neighbor-graph is not connected, it doubles k until it is connected.) Next, this method multiplies the matrix by scaleFactor. Finally, it refines the points to restore local distances. (It would not typically be efficient to call this in a tight loop, because that would perform the neighbor-finding step each time.) Returns the number of neighbors actually used to find a connected graph.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |