Tapkee
tapkee Namespace Reference

Namespaces

namespace  keywords
namespace  tapkee_internal

Classes

struct  dummy_features_callback
struct  dummy_kernel_callback
struct  dummy_distance_callback
struct  eigen_features_callback
struct  eigen_kernel_callback
struct  eigen_distance_callback
struct  precomputed_kernel_callback
struct  precomputed_distance_callback
struct  initialize
struct  TapkeeOutput
 Return result of the library - a pair of DenseMatrix (embedding) and ProjectingFunction. More...
class  wrong_parameter_error
 An exception type that is thrown in case if wrong parameter value is passed. More...
class  wrong_parameter_type_error
 An exception type that is thrown in case if wrong parameter value is passed. More...
class  missed_parameter_error
 An exception type that is thrown in case of missed parameter, i.e. when some required parameter is not set. More...
class  unsupported_method_error
 An exception type that is thrown when unsupported method is called. More...
class  not_enough_memory_error
 An exception type that is thrown when the library can't get enough memory. More...
class  multiple_parameter_error
 An exception type that is thrown when some parameter is passed more than once. More...
class  cancelled_exception
 An exception type that is thrown when computations were cancelled. More...
class  eigendecomposition_error
 An exception type that is thrown when eigendecomposition is failed. More...
struct  Message
class  Parameter
class  CheckedParameter
class  ParametersSet
struct  ProjectionImplementation
 A base class for implementation of projecting. More...
struct  ProjectingFunction
 A pimpl wrapper for projecting function. More...
struct  MatrixProjectionImplementation
 Basic ProjectionImplementation that subtracts mean from the vector and multiplies projecting matrix with it. More...
struct  BatchCallbackTraits
class  is_dummy
struct  MethodTraits
 Traits used to obtain information about dimension reduction methods compile-time. More...
class  LoggerImplementation
 A base class for logger required by the library. More...
class  DefaultLoggerImplementation
 Default std::cout implementation of LoggerImplementation. More...
class  LoggingSingleton
 Main logging singleton used by the library. Can use provided LoggerImplementation if necessary. By default uses DefaultLoggerImplementation. More...

Typedefs

typedef double ScalarType
typedef int IndexType
typedef Eigen::Matrix
< tapkee::ScalarType,
Eigen::Dynamic, 1 > 
DenseVector
typedef Eigen::Matrix
< tapkee::ScalarType,
Eigen::Dynamic, Eigen::Dynamic > 
DenseMatrix
typedef tapkee::DenseMatrix DenseSymmetricMatrix
typedef Eigen::DiagonalMatrix
< tapkee::ScalarType,
Eigen::Dynamic > 
DenseDiagonalMatrix
typedef Eigen::SparseMatrix
< tapkee::ScalarType
SparseWeightMatrix
typedef Eigen::SparseMatrix
< tapkee::ScalarType
SparseMatrix
typedef
Eigen::SelfAdjointEigenSolver
< tapkee::DenseMatrix
DenseSelfAdjointEigenSolver
typedef Eigen::LDLT
< tapkee::DenseMatrix
DenseSolver
typedef Eigen::SimplicialLDLT
< tapkee::SparseWeightMatrix
SparseSolver

Enumerations

enum  DimensionReductionMethod {
  KernelLocallyLinearEmbedding, NeighborhoodPreservingEmbedding, KernelLocalTangentSpaceAlignment, LinearLocalTangentSpaceAlignment,
  HessianLocallyLinearEmbedding, LaplacianEigenmaps, LocalityPreservingProjections, DiffusionMap,
  Isomap, LandmarkIsomap, MultidimensionalScaling, LandmarkMultidimensionalScaling,
  StochasticProximityEmbedding, KernelPCA, PCA, RandomProjection,
  FactorAnalysis, tDistributedStochasticNeighborEmbedding, ManifoldSculpting, PassThru
}
enum  NeighborsMethod { Brute, VpTree, CoverTree }
enum  EigenMethod { Arpack, Randomized, Dense }

Functions

IndexType uniform_random_index ()
IndexType uniform_random_index_bounded (IndexType upper)
ScalarType uniform_random ()
ScalarType gaussian_random ()
template<class RAI >
void random_shuffle (RAI first, RAI last)
template<class RandomAccessIterator , class KernelCallback , class DistanceCallback , class FeaturesCallback >
TapkeeOutput embed (RandomAccessIterator begin, RandomAccessIterator end, KernelCallback kernel_callback, DistanceCallback distance_callback, FeaturesCallback features_callback, ParametersSet parameters)
std::string get_method_name (DimensionReductionMethod m)
std::string get_neighbors_method_name (NeighborsMethod m)
std::string get_eigen_method_name (EigenMethod m)

Variables

static NeighborsMethod default_neighbors_method = CoverTree
static EigenMethod default_eigen_method = Arpack

Typedef Documentation

typedef Eigen::DiagonalMatrix<tapkee::ScalarType,Eigen::Dynamic> DenseDiagonalMatrix

dense diagonal matrix

Definition at line 27 of file types.hpp.

typedef Eigen::Matrix<tapkee::ScalarType,Eigen::Dynamic,Eigen::Dynamic> DenseMatrix

dense matrix type (non-overridable)

Definition at line 23 of file types.hpp.

typedef Eigen::SelfAdjointEigenSolver<tapkee::DenseMatrix> DenseSelfAdjointEigenSolver

selfadjoint solver (non-overridable)

Definition at line 33 of file types.hpp.

typedef Eigen::LDLT<tapkee::DenseMatrix> DenseSolver

dense solver (non-overridable)

Definition at line 35 of file types.hpp.

dense symmetric matrix (non-overridable, currently just dense matrix, can be improved later)

Definition at line 25 of file types.hpp.

typedef Eigen::Matrix<tapkee::ScalarType,Eigen::Dynamic,1> DenseVector

dense vector type (non-overridable)

Definition at line 21 of file types.hpp.

typedef int IndexType

indexing type (non-overridable) set to int for compatibility with OpenMP 2.0

Definition at line 19 of file types.hpp.

typedef double ScalarType

default scalar value (can be overrided with TAPKEE_CUSTOM_INTERNAL_NUMTYPE define)

Definition at line 15 of file types.hpp.

typedef Eigen::SparseMatrix<tapkee::ScalarType> SparseMatrix

sparse matrix type (non-overridable)

Definition at line 31 of file types.hpp.

typedef Eigen::SimplicialLDLT<tapkee::SparseWeightMatrix> SparseSolver

Definition at line 45 of file types.hpp.

typedef Eigen::SparseMatrix<tapkee::ScalarType> SparseWeightMatrix

sparse weight matrix type (non-overridable)

Definition at line 29 of file types.hpp.


Enumeration Type Documentation

Dimension reduction methods.

Enumerator:
KernelLocallyLinearEmbedding 

Kernel Locally Linear Embedding as described in [Decoste2001]

NeighborhoodPreservingEmbedding 

Neighborhood Preserving Embedding as described in [He2005]

KernelLocalTangentSpaceAlignment 

Local Tangent Space Alignment as described in [Zhang2002]

LinearLocalTangentSpaceAlignment 

Linear Local Tangent Space Alignment as described in [Zhang2007]

HessianLocallyLinearEmbedding 

Hessian Locally Linear Embedding as described in [Donoho2003]

LaplacianEigenmaps 

Laplacian Eigenmaps as described in [Belkin2002]

LocalityPreservingProjections 

Locality Preserving Projections as described in [He2003]

DiffusionMap 

Diffusion map as described in [Coifman2006]

Isomap 

Isomap as described in [Tenenbaum2000]

LandmarkIsomap 

Landmark Isomap as described in [deSilva2002]

MultidimensionalScaling 

Multidimensional scaling as described in [Cox2000]

LandmarkMultidimensionalScaling 

Landmark multidimensional scaling as described in [deSilva2004]

StochasticProximityEmbedding 

Stochastic Proximity Embedding as described in [Agrafiotis2003]

KernelPCA 

Kernel PCA as described in [Scholkopf1997]

PCA 

Principal Component Analysis

RandomProjection 

Random Projection as described in [Kaski1998]

FactorAnalysis 

Factor Analysis

tDistributedStochasticNeighborEmbedding 

t-SNE and Barnes-Hut-SNE as described in [vanDerMaaten2008] and [vanDerMaaten2013]

ManifoldSculpting 

Manifold Sculpting as described in [Gashler2007]

PassThru 

Passing through (doing nothing just passes the data through)

Definition at line 12 of file defines/methods.hpp.

Eigendecomposition methods.

Enumerator:
Arpack 

ARPACK-based method (requires the ARPACK library binaries to be available around). Recommended to be used as a default method. Supports both generalized and standard eigenproblems.

Randomized 

Randomized method (implementation taken from the redsvd lib). Supports only standard but not generalized eigenproblems.

Dense 

Eigen library dense method (could be useful for debugging). Computes all eigenvectors thus can be very slow doing large-scale.

Definition at line 119 of file defines/methods.hpp.

Neighbors computation methods.

Enumerator:
Brute 

Brute force method with not least than $ O(N N \log k) $ time complexity. Recommended to be used only in debug purposes.

VpTree 

Covertree-based method with approximate $ O(\log N) $ time complexity. Recommended to be used as a default method.

CoverTree 

Definition at line 99 of file defines/methods.hpp.


Function Documentation

TapkeeOutput tapkee::embed ( RandomAccessIterator  begin,
RandomAccessIterator  end,
KernelCallback  kernel_callback,
DistanceCallback  distance_callback,
FeaturesCallback  features_callback,
ParametersSet  parameters 
)

Constructs a dense embedding with specified dimensionality using provided data represented by random access iterators and provided callbacks. Returns ReturnType that is essentially a pair of DenseMatrix (embedding of provided data) and a ProjectingFunction with corresponding ProjectionImplementation used to project data out of the sample.

Template Parameters:
RandomAccessIteratorrandom access iterator with no specific capabilities that points to some RandomAccessIterator::value_type (the simplest case is RandomAccessIterator::value_type being int).
KernelCallbacka callback that defines
 ScalarType kernel(const RandomAccessIterator::value_type&, const RandomAccessIterator::value_type&) 
function of two iterators. This method should return value of Mercer kernel function between vectors/objects iterators pointing to.
DistanceCallbacka callback that defines
 ScalarType distance(const RandomAccessIterator::value_type&, const RandomAccessIterator::value_type&) 
function of two iterators.
FeaturesCallbacka callback that defines
 void vector(const RandomAccessIterator::value_type&, DenseVector&) 
function used to access feature vector pointed by iterator. The callback should put the feature vector pointed by the iterator to the provided vector.

Parameters required by the chosen algorithm are obtained from the parameter map. It gracefully fails during runtime and throws an exception if some of required parameters are not specified or have improper values.

Parameters:
beginbegin iterator of data
endend iterator of data
kernel_callbackthe kernel callback implementing
 ScalarType kernel(const RandomAccessIterator::value_type&, const RandomAccessIterator::value_type&) 
Used by the following methods:
distance_callbackthe distance callback implementing
 ScalarType distance(const RandomAccessIterator::value_type&, const RandomAccessIterator::value_type&) 
Used by the following methods:
feature_vector_callbackthe feature vector callback implementing
 void vector(const RandomAccessIterator::value_type&, DenseVector&) 
Used by the following methods:
parametersa set of parameters formed with keywords expression.
Exceptions:
tapkee::wrong_parameter_errorif wrong parameter value is passed
tapkee::missed_parameter_errorif some required parameter is missed
tapkee::multiple_parameter_errorif some parameter is provided more than once
tapkee::unsupported_method_errorif some method or combination of methods is unsupported
tapkee::not_enough_memory_errorif there is not enough memory to perform the computations
tapkee::cancelled_exceptionif computations were cancelled due to cancel_function returned true
tapkee::eigendecomposition_errorif eigendecomposition has failed

Definition at line 95 of file embed.hpp.

Definition at line 39 of file random.hpp.

std::string tapkee::get_eigen_method_name ( EigenMethod  m)

Returns the name of the provided eigen method

Definition at line 56 of file naming.hpp.

std::string tapkee::get_method_name ( DimensionReductionMethod  m)

Returns the name of the provided method

Definition at line 13 of file naming.hpp.

std::string tapkee::get_neighbors_method_name ( NeighborsMethod  m)

Returns the name of the provided neighbors method

Definition at line 42 of file naming.hpp.

void tapkee::random_shuffle ( RAI  first,
RAI  last 
)

Definition at line 58 of file random.hpp.

Definition at line 30 of file random.hpp.

Definition at line 16 of file random.hpp.

Definition at line 25 of file random.hpp.


Variable Documentation

Definition at line 135 of file defines/methods.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines