GClasses
|
Manifold Sculpting. A non-linear dimensionality reduction algorithm. (See Gashler, Michael S. and Ventura, Dan and Martinez, Tony. Iterative non-linear dimensionality reduction with manifold sculpting. In Advances in Neural Information Processing Systems 20, pages 513–520, MIT Press, Cambridge, MA, 2008.) More...
#include <GManifold.h>
Public Member Functions | |
GManifoldSculpting (size_t nNeighbors, size_t targetDims, GRand *pRand) | |
virtual | ~GManifoldSculpting () |
virtual GMatrix * | doit (GMatrix &in) |
Perform NLDR. | |
virtual sp_relation & | relationAfter () |
GMatrix & | data () |
void | beginTransform (GMatrix *pRealSpaceData) |
Call this before calling SquishPass. pRealSpaceData should be a dataset of all real values. | |
double | squishPass (size_t nSeedDataPoint) |
Perform one iteration of squishing. Returns a heuristical error value. | |
void | setSquishingRate (double d) |
Set the rate of squishing. (.99 is a good value) | |
double | learningRate () |
Returns the current learning rate. | |
double | aveNeighborDist () |
Returns the average distance between neighbors. | |
size_t | countShortcuts (size_t nThreshold) |
Counts the number of times that a point has a neighbor with an index that is >= nThreshold away from this points index. (If the manifold is sampled in order such that points are expected to find neighbors with indexes close to their own, this can serve to identify when parts of the manifold are too close to other parts for so many neighbors to be used.) | |
void | setPreprocessedData (GMatrix *pData) |
This will takes ownership of pData. (It will modify pData too.) Specifies reduced dimensionality data created by another algorithm, which should be refined using Manifold Sculpting. | |
void | setMinAndMaxNeighborDist (double min, double max) |
Neighbors that are closer than min or farther than max will be ignored. The default is [0, 1e20]. It is common to make nNeighbors big and max small so that the hyper-sphere will define the neighborhood. | |
void | clampPoint (size_t n) |
Partially supervise the specified point. | |
void | setNeighborFinder (GNeighborFinder *pNF) |
Specifies to use the neighborhoods determined by the specified neighbor-finder instead of the nearest Euclidean-distance neighbors. If this method is called, pNF should have the same number of neighbors and the same dataset as is passed into this class. | |
Protected Member Functions | |
struct GManifoldSculptingStuff * | stuff (size_t n) |
struct GManifoldSculptingNeighbor * | record (size_t n) |
virtual double | supervisedError (size_t nPoint) |
You can overload this to add some intelligent supervision to the heuristic. | |
void | calculateMetadata (GMatrix *pData) |
double | vectorCorrelation (double *pdA, double *pdV, double *pdB) |
double | vectorCorrelation2 (double squaredScale, size_t a, size_t vertex, struct GManifoldSculptingNeighbor *pNeighborRec) |
double | computeError (size_t nPoint) |
size_t | adjustDataPoint (size_t nPoint, double *pError) |
double | averageNeighborDistance (size_t nDims) |
void | plotData (float radius) |
void | moveMeanToOrigin () |
Protected Attributes | |
size_t | m_nDimensions |
size_t | m_nNeighbors |
size_t | m_nStuffIndex |
size_t | m_nRecordSize |
size_t | m_nCurrentDimension |
size_t | m_nTargetDims |
size_t | m_nPass |
double | m_scale |
double | m_dAveNeighborDist |
double | m_dSquishingRate |
double | m_dLearningRate |
double | m_minNeighborDist |
double | m_maxNeighborDist |
std::deque< size_t > | m_q |
sp_relation | m_pRelationAfter |
GRand * | m_pRand |
GMatrix * | m_pData |
unsigned char * | m_pMetaData |
GNeighborFinder * | m_pNF |
Manifold Sculpting. A non-linear dimensionality reduction algorithm. (See Gashler, Michael S. and Ventura, Dan and Martinez, Tony. Iterative non-linear dimensionality reduction with manifold sculpting. In Advances in Neural Information Processing Systems 20, pages 513–520, MIT Press, Cambridge, MA, 2008.)
GClasses::GManifoldSculpting::GManifoldSculpting | ( | size_t | nNeighbors, |
size_t | targetDims, | ||
GRand * | pRand | ||
) |
virtual GClasses::GManifoldSculpting::~GManifoldSculpting | ( | ) | [virtual] |
size_t GClasses::GManifoldSculpting::adjustDataPoint | ( | size_t | nPoint, |
double * | pError | ||
) | [protected] |
double GClasses::GManifoldSculpting::aveNeighborDist | ( | ) | [inline] |
Returns the average distance between neighbors.
double GClasses::GManifoldSculpting::averageNeighborDistance | ( | size_t | nDims | ) | [protected] |
void GClasses::GManifoldSculpting::beginTransform | ( | GMatrix * | pRealSpaceData | ) |
Call this before calling SquishPass. pRealSpaceData should be a dataset of all real values.
void GClasses::GManifoldSculpting::calculateMetadata | ( | GMatrix * | pData | ) | [protected] |
void GClasses::GManifoldSculpting::clampPoint | ( | size_t | n | ) |
Partially supervise the specified point.
double GClasses::GManifoldSculpting::computeError | ( | size_t | nPoint | ) | [protected] |
size_t GClasses::GManifoldSculpting::countShortcuts | ( | size_t | nThreshold | ) |
Counts the number of times that a point has a neighbor with an index that is >= nThreshold away from this points index. (If the manifold is sampled in order such that points are expected to find neighbors with indexes close to their own, this can serve to identify when parts of the manifold are too close to other parts for so many neighbors to be used.)
GMatrix& GClasses::GManifoldSculpting::data | ( | ) | [inline] |
Perform NLDR.
Implements GClasses::GTransform.
double GClasses::GManifoldSculpting::learningRate | ( | ) | [inline] |
Returns the current learning rate.
void GClasses::GManifoldSculpting::moveMeanToOrigin | ( | ) | [protected] |
void GClasses::GManifoldSculpting::plotData | ( | float | radius | ) | [protected] |
struct GManifoldSculptingNeighbor* GClasses::GManifoldSculpting::record | ( | size_t | n | ) | [inline, read, protected] |
virtual sp_relation& GClasses::GManifoldSculpting::relationAfter | ( | ) | [inline, virtual] |
void GClasses::GManifoldSculpting::setMinAndMaxNeighborDist | ( | double | min, |
double | max | ||
) | [inline] |
Neighbors that are closer than min or farther than max will be ignored. The default is [0, 1e20]. It is common to make nNeighbors big and max small so that the hyper-sphere will define the neighborhood.
void GClasses::GManifoldSculpting::setNeighborFinder | ( | GNeighborFinder * | pNF | ) | [inline] |
Specifies to use the neighborhoods determined by the specified neighbor-finder instead of the nearest Euclidean-distance neighbors. If this method is called, pNF should have the same number of neighbors and the same dataset as is passed into this class.
void GClasses::GManifoldSculpting::setPreprocessedData | ( | GMatrix * | pData | ) |
This will takes ownership of pData. (It will modify pData too.) Specifies reduced dimensionality data created by another algorithm, which should be refined using Manifold Sculpting.
void GClasses::GManifoldSculpting::setSquishingRate | ( | double | d | ) | [inline] |
Set the rate of squishing. (.99 is a good value)
double GClasses::GManifoldSculpting::squishPass | ( | size_t | nSeedDataPoint | ) |
Perform one iteration of squishing. Returns a heuristical error value.
struct GManifoldSculptingStuff* GClasses::GManifoldSculpting::stuff | ( | size_t | n | ) | [inline, read, protected] |
virtual double GClasses::GManifoldSculpting::supervisedError | ( | size_t | nPoint | ) | [inline, protected, virtual] |
You can overload this to add some intelligent supervision to the heuristic.
double GClasses::GManifoldSculpting::vectorCorrelation | ( | double * | pdA, |
double * | pdV, | ||
double * | pdB | ||
) | [protected] |
double GClasses::GManifoldSculpting::vectorCorrelation2 | ( | double | squaredScale, |
size_t | a, | ||
size_t | vertex, | ||
struct GManifoldSculptingNeighbor * | pNeighborRec | ||
) | [protected] |
double GClasses::GManifoldSculpting::m_dAveNeighborDist [protected] |
double GClasses::GManifoldSculpting::m_dLearningRate [protected] |
double GClasses::GManifoldSculpting::m_dSquishingRate [protected] |
double GClasses::GManifoldSculpting::m_maxNeighborDist [protected] |
double GClasses::GManifoldSculpting::m_minNeighborDist [protected] |
size_t GClasses::GManifoldSculpting::m_nCurrentDimension [protected] |
size_t GClasses::GManifoldSculpting::m_nDimensions [protected] |
size_t GClasses::GManifoldSculpting::m_nNeighbors [protected] |
size_t GClasses::GManifoldSculpting::m_nPass [protected] |
size_t GClasses::GManifoldSculpting::m_nRecordSize [protected] |
size_t GClasses::GManifoldSculpting::m_nStuffIndex [protected] |
size_t GClasses::GManifoldSculpting::m_nTargetDims [protected] |
GMatrix* GClasses::GManifoldSculpting::m_pData [protected] |
unsigned char* GClasses::GManifoldSculpting::m_pMetaData [protected] |
GNeighborFinder* GClasses::GManifoldSculpting::m_pNF [protected] |
GRand* GClasses::GManifoldSculpting::m_pRand [protected] |
std::deque<size_t> GClasses::GManifoldSculpting::m_q [protected] |
double GClasses::GManifoldSculpting::m_scale [protected] |