the class LocallyLinearEmbedding used to preprocess data using Locally Linear Embedding algorithm described in
Saul, L. K., Ave, P., Park, F., & Roweis, S. T. (2001). An Introduction to Locally Linear Embedding. Available from, 290(5500), 2323-2326. Retrieved from: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.123.7319&rep=rep1&type=pdf
The process of finding nearest neighbors is parallel and involves Fibonacci Heap and Euclidian distance.
Linear reconstruction step runs in parallel for objects and involves LAPACK routine DPOSV for solving a system of linear equations.
The eigenproblem stated in the algorithm is solved with LAPACK routine DSYEVR or with ARPACK DSAUPD/DSEUPD routines if available.
Due to computation speed, ARPACK is being used with small regularization of weight matrix and Cholesky factorization is used internally for Lanzcos iterations. If the results aren't reasonable LUP factorization could be used with posdef parameter set to false using set_posdef.
Definition at line 50 of file LocallyLinearEmbedding.h.
Public Member Functions | |
CLocallyLinearEmbedding () | |
virtual | ~CLocallyLinearEmbedding () |
virtual bool | init (CFeatures *features) |
virtual void | cleanup () |
virtual SGMatrix< float64_t > | apply_to_feature_matrix (CFeatures *features) |
virtual SGVector< float64_t > | apply_to_feature_vector (SGVector< float64_t > vector) |
void | set_k (int32_t k) |
int32_t | get_k () |
void | set_posdef (bool posdef) |
bool | get_posdef () |
virtual const char * | get_name () const |
virtual EPreprocessorType | get_type () const |
Protected Member Functions | |
void | init () |
SGMatrix< float64_t > | find_null_space (SGMatrix< float64_t > matrix, int dimension, bool force_lapack) |
SGMatrix< int32_t > | get_neighborhood_matrix (CDistance *distance) |
Static Protected Member Functions | |
static void * | run_neighborhood_thread (void *p) |
static void * | run_linearreconstruction_thread (void *p) |
Protected Attributes | |
int32_t | m_k |
bool | m_posdef |
constructor
Definition at line 79 of file LocallyLinearEmbedding.cpp.
~CLocallyLinearEmbedding | ( | ) | [virtual] |
destructor
Definition at line 95 of file LocallyLinearEmbedding.cpp.
apply preprocessor to features
features |
Reimplemented from CDimensionReductionPreprocessor.
Reimplemented in CHessianLocallyLinearEmbedding, CKernelLocallyLinearEmbedding, and CLocalTangentSpaceAlignment.
Definition at line 108 of file LocallyLinearEmbedding.cpp.
apply preprocessor to feature vector, not supported for LLE
vector |
Reimplemented from CDimensionReductionPreprocessor.
Reimplemented in CHessianLocallyLinearEmbedding, CKernelLocallyLinearEmbedding, and CLocalTangentSpaceAlignment.
Definition at line 234 of file LocallyLinearEmbedding.cpp.
void cleanup | ( | ) | [virtual] |
cleanup
Reimplemented from CDimensionReductionPreprocessor.
Reimplemented in CHessianLocallyLinearEmbedding, CKernelLocallyLinearEmbedding, and CLocalTangentSpaceAlignment.
Definition at line 104 of file LocallyLinearEmbedding.cpp.
SGMatrix< float64_t > find_null_space | ( | SGMatrix< float64_t > | matrix, | |
int | dimension, | |||
bool | force_lapack | |||
) | [protected] |
find null space of given matrix
matrix | given matrix | |
dimension | dimension of null space to be computed | |
force_lapack | true if lapack should be used |
Definition at line 240 of file LocallyLinearEmbedding.cpp.
int32_t get_k | ( | ) |
virtual const char* get_name | ( | void | ) | const [virtual] |
get name
Reimplemented from CDimensionReductionPreprocessor.
Reimplemented in CHessianLocallyLinearEmbedding, CKernelLocallyLinearEmbedding, and CLocalTangentSpaceAlignment.
Definition at line 112 of file LocallyLinearEmbedding.h.
construct neighborhood matrix by distance
distance | distance to be used |
Definition at line 383 of file LocallyLinearEmbedding.cpp.
bool get_posdef | ( | ) |
getter for posdef parameter
Definition at line 106 of file LocallyLinearEmbedding.h.
virtual EPreprocessorType get_type | ( | ) | const [virtual] |
get type
Reimplemented from CDimensionReductionPreprocessor.
Reimplemented in CHessianLocallyLinearEmbedding, CKernelLocallyLinearEmbedding, and CLocalTangentSpaceAlignment.
Definition at line 115 of file LocallyLinearEmbedding.h.
bool init | ( | CFeatures * | features | ) | [virtual] |
init
features |
Reimplemented from CDimensionReductionPreprocessor.
Reimplemented in CHessianLocallyLinearEmbedding, CKernelLocallyLinearEmbedding, and CLocalTangentSpaceAlignment.
Definition at line 99 of file LocallyLinearEmbedding.cpp.
void init | ( | void | ) | [protected] |
default init
Reimplemented from CDimensionReductionPreprocessor.
Reimplemented in CKernelLocallyLinearEmbedding.
Definition at line 85 of file LocallyLinearEmbedding.cpp.
void * run_linearreconstruction_thread | ( | void * | p | ) | [static, protected] |
runs linear reconstruction thread
p | thread params |
Reimplemented in CKernelLocallyLinearEmbedding.
Definition at line 307 of file LocallyLinearEmbedding.cpp.
void * run_neighborhood_thread | ( | void * | p | ) | [static, protected] |
runs neighborhood determination thread
p | thread params |
Reimplemented in CKernelLocallyLinearEmbedding.
Definition at line 445 of file LocallyLinearEmbedding.cpp.
void set_k | ( | int32_t | k | ) |
void set_posdef | ( | bool | posdef | ) |
setter for posdef parameter
posdef | posdef value |
Definition at line 98 of file LocallyLinearEmbedding.h.
int32_t m_k [protected] |
number of neighbors
Definition at line 150 of file LocallyLinearEmbedding.h.
bool m_posdef [protected] |
boolean indicating if matrix should be considered as positive-definite
Definition at line 153 of file LocallyLinearEmbedding.h.