Skip to content

Commit

Permalink
Added references to LLTSA and NPE, updated NPE impl
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Oct 23, 2011
1 parent e74284b commit 1ca6b60
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
9 changes: 8 additions & 1 deletion src/shogun/converter/LinearLocalTangentSpaceAlignment.h
Expand Up @@ -23,7 +23,14 @@ namespace shogun
class CFeatures;
class CDistance;

/** @brief LinearLocalTangentSpaceAlignment
/** @brief LinearLocalTangentSpaceAlignment converter used to
* construct embeddings as described in:
*
* Zhang, T., Yang, J., Zhao, D., & Ge, X. (2007).
* Linear local tangent space alignment and application to face recognition.
* Neurocomputing, 70(7-9), 1547-1553.
* Retrieved from http://linkinghub.elsevier.com/retrieve/pii/S0925231206004577
*
*/
class CLinearLocalTangentSpaceAlignment: public CLocalTangentSpaceAlignment
{
Expand Down
14 changes: 6 additions & 8 deletions src/shogun/converter/NeighborhoodPreservingEmbedding.cpp
Expand Up @@ -11,11 +11,9 @@
#include <shogun/converter/NeighborhoodPreservingEmbedding.h>
#include <shogun/lib/config.h>
#ifdef HAVE_LAPACK
#include <shogun/converter/EmbeddingConverter.h>
#include <shogun/mathematics/arpack.h>
#include <shogun/mathematics/lapack.h>
#include <shogun/lib/FibonacciHeap.h>
#include <shogun/base/DynArray.h>
#include <shogun/mathematics/Math.h>
#include <shogun/io/SGIO.h>
#include <shogun/lib/Time.h>
Expand Down Expand Up @@ -59,16 +57,16 @@ SGMatrix<float64_t> CNeighborhoodPreservingEmbedding::construct_embedding(CFeatu
float64_t* evals = SG_MALLOC(float64_t, dim);
float64_t* evectors = SG_MALLOC(float64_t, dimension*dim);
int32_t info = 0;
#ifdef HAVE_ARPACK
arpack_dsxupd(lhs_M,rhs_M,false,dim,dimension,"LA",false,3,true,m_nullspace_shift,0.0,
evals,evectors,info);
#else
wrap_dsygvx(1,'V','U',dim,lhs_M,dim,rhs_M,dim,dim-dimension+1,dim,evals,evectors,&info);
ASSERT(info==0);
#endif
SG_FREE(lhs_M);
SG_FREE(rhs_M);
SG_FREE(evals);

for (i=0; i<dimension/2; i++)
{
cblas_dswap(dim,evectors+i*dim,1,evectors+(dimension-i-1)*dim,1);
}
if (info!=0) SG_ERROR("Failed to solve eigenproblem (%d)\n",info);

cblas_dgemm(CblasColMajor,CblasTrans,CblasNoTrans,N,dimension,dim,1.0,feature_matrix.matrix,dim,evectors,dim,0.0,XTM,N);
SG_FREE(evectors);
Expand Down
9 changes: 8 additions & 1 deletion src/shogun/converter/NeighborhoodPreservingEmbedding.h
Expand Up @@ -23,7 +23,14 @@ namespace shogun
class CFeatures;
class CDistance;

/** @brief NeighborhoodPreservingEmbedding
/** @brief NeighborhoodPreservingEmbedding converter used to
* construct embeddings as described in:
*
* He, X., Cai, D., Yan, S., & Zhang, H.-J. (2005).
* Neighborhood preserving embedding.
* Tenth IEEE International Conference on Computer Vision ICCV05 Volume 1, 2, 1208-1213. Ieee.
* Retrieved from http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=1544858
*
*/
class CNeighborhoodPreservingEmbedding: public CLocallyLinearEmbedding
{
Expand Down

0 comments on commit 1ca6b60

Please sign in to comment.