A neighbor finder that specializes in dynamical systems. It determines neighbors by searching for the shortest path of actions between observations, and computes the distance as the number of time-steps in that path. This algorithm was published in Gashler, Michael S. and Martinez, Tony. Temporal nonlinear dimensionality reduction. In Proceedings of the International Joint Conference on Neural Networks IJCNN’11, pages 1959–1966, IEEE Press, 2011.
More...
#include <GNeighborFinder.h>
|
| GTemporalNeighborFinder (GMatrix *pObservations, GMatrix *pActions, bool ownActionsData, size_t neighborCount, GRand *pRand, size_t maxDims=12) |
| pObservations is typically a matrix of high-dimensional observations. pActions is a matrix of corresponding actions (peformed after the corresponding observation was observed). If ownActionsData is true, then this object will delete pActions when it is deleted. This neighbor-finder is somewhat slow in high-dimensional space. Consequently, if the data has more than maxDims dimensions, it will internally use PCA to reduce it to maxDims dimensions before computing neighbors. The default is 12. More...
|
|
virtual | ~GTemporalNeighborFinder () |
|
virtual void | neighbors (size_t *pOutNeighbors, size_t index) |
| Computes the neighbors of the specified vector. More...
|
|
virtual void | neighbors (size_t *pOutNeighbors, double *pOutDistances, size_t index) |
| Computes the neighbors and distances of the specified vector. More...
|
|
| GNeighborFinder (const GMatrix *pData, size_t neighborCount) |
|
virtual | ~GNeighborFinder () |
|
virtual bool | canGeneralize () |
| Returns true if this neighbor finder can operate on points that are not in the dataset passed to the constructor. More...
|
|
const GMatrix * | data () |
| Returns the data passed to the constructor of this object. More...
|
|
virtual bool | isCached () |
| Returns true iff the neighbors and distances are pre-computed. More...
|
|
size_t | neighborCount () |
| Returns the number of neighbors to find. More...
|
|
void | sortNeighbors (size_t *pNeighbors, double *pDistances) |
| Uses Quick Sort to sort the neighbors from least to most dissimilar, followed by any slots for with INVALID_INDEX for the index. (Note: This method is pointless, since the neighors are already guaranteed to come in sorted order. Todo: figure out why it is still here) More...
|
|
|
bool | findPath (size_t from, size_t to, double *path, double distCap) |
| Returns false if distCap is exceeded, or if the results are too imprecise to be reliable. Otherwise, returns true, and path is set to contain the number of times that each action must be performed to travel from point "from" to point "to". More...
|
|
GMatrix * | preprocessObservations (GMatrix *pObs, size_t maxDims) |
| This method uses PCA to reduce pObs to maxDims dimensions. (If pObs is already small enough, it just returns pObs.) More...
|
|
|
static void | sortNeighbors (size_t neighborCount, size_t *pNeighbors, double *pDistances) |
| Uses Quick Sort to sort the neighbors from least to most dissimilar, followed by any slots for with INVALID_INDEX for the index. (Note: This method is pointless, since the neighors are already guaranteed to come in sorted order. Todo: figure out why it is still here) More...
|
|
A neighbor finder that specializes in dynamical systems. It determines neighbors by searching for the shortest path of actions between observations, and computes the distance as the number of time-steps in that path. This algorithm was published in Gashler, Michael S. and Martinez, Tony. Temporal nonlinear dimensionality reduction. In Proceedings of the International Joint Conference on Neural Networks IJCNN’11, pages 1959–1966, IEEE Press, 2011.
GClasses::GTemporalNeighborFinder::GTemporalNeighborFinder |
( |
GMatrix * |
pObservations, |
|
|
GMatrix * |
pActions, |
|
|
bool |
ownActionsData, |
|
|
size_t |
neighborCount, |
|
|
GRand * |
pRand, |
|
|
size_t |
maxDims = 12 |
|
) |
| |
pObservations is typically a matrix of high-dimensional observations. pActions is a matrix of corresponding actions (peformed after the corresponding observation was observed). If ownActionsData is true, then this object will delete pActions when it is deleted. This neighbor-finder is somewhat slow in high-dimensional space. Consequently, if the data has more than maxDims dimensions, it will internally use PCA to reduce it to maxDims dimensions before computing neighbors. The default is 12.
virtual GClasses::GTemporalNeighborFinder::~GTemporalNeighborFinder |
( |
| ) |
|
|
virtual |
bool GClasses::GTemporalNeighborFinder::findPath |
( |
size_t |
from, |
|
|
size_t |
to, |
|
|
double * |
path, |
|
|
double |
distCap |
|
) |
| |
|
protected |
Returns false if distCap is exceeded, or if the results are too imprecise to be reliable. Otherwise, returns true, and path is set to contain the number of times that each action must be performed to travel from point "from" to point "to".
virtual void GClasses::GTemporalNeighborFinder::neighbors |
( |
size_t * |
pOutNeighbors, |
|
|
size_t |
index |
|
) |
| |
|
virtual |
virtual void GClasses::GTemporalNeighborFinder::neighbors |
( |
size_t * |
pOutNeighbors, |
|
|
double * |
pOutDistances, |
|
|
size_t |
index |
|
) |
| |
|
virtual |
GMatrix* GClasses::GTemporalNeighborFinder::preprocessObservations |
( |
GMatrix * |
pObs, |
|
|
size_t |
maxDims |
|
) |
| |
|
protected |
This method uses PCA to reduce pObs to maxDims dimensions. (If pObs is already small enough, it just returns pObs.)
size_t GClasses::GTemporalNeighborFinder::m_maxDims |
|
protected |
bool GClasses::GTemporalNeighborFinder::m_ownActionsData |
|
protected |
GMatrix* GClasses::GTemporalNeighborFinder::m_pActions |
|
protected |
GMatrix* GClasses::GTemporalNeighborFinder::m_pPreprocessed |
|
protected |
GRand* GClasses::GTemporalNeighborFinder::m_pRand |
|
protected |