Tapkee
tapkee Namespace Reference

Namespaces

 tapkee_internal
 

Classes

struct  BatchCallbackTraits
 
class  cancelled_exception
 
struct  ComputationStrategy
 
class  DefaultLoggerImplementation
 
struct  dummy_distance_callback
 
struct  dummy_features_callback
 
struct  dummy_kernel_callback
 
struct  eigen_distance_callback
 
struct  eigen_features_callback
 
struct  eigen_kernel_callback
 
class  eigendecomposition_error
 
struct  EigenMethod
 
struct  initialize
 
class  is_dummy
 
class  LoggerImplementation
 
class  LoggingSingleton
 
struct  MatrixProjectionImplementation
 
struct  Method
 
struct  MethodTraits
 
class  missed_parameter_error
 
class  multiple_parameter_error
 
struct  NeighborsMethod
 
class  no_data_error
 
class  not_enough_memory_error
 
struct  precomputed_distance_callback
 
struct  precomputed_kernel_callback
 
struct  ProjectingFunction
 
struct  ProjectionImplementation
 
struct  TapkeeOutput
 
class  unsupported_method_error
 
class  wrong_parameter_error
 
class  wrong_parameter_type_error
 

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::ScalarTypeSparseWeightMatrix
 
typedef Eigen::SparseMatrix< tapkee::ScalarTypeSparseMatrix
 
typedef Eigen::SelfAdjointEigenSolver< tapkee::DenseMatrixDenseSelfAdjointEigenSolver
 
typedef Eigen::LDLT< tapkee::DenseMatrixDenseSolver
 
typedef Eigen::SimplicialLDLT< tapkee::SparseWeightMatrixSparseSolver
 
typedef stichwort::ParametersSet ParametersSet
 
typedef stichwort::Parameter Parameter
 

Enumerations

enum  DimensionReductionMethod {
  KernelLocallyLinearEmbedding, NeighborhoodPreservingEmbedding, KernelLocalTangentSpaceAlignment, LinearLocalTangentSpaceAlignment,
  HessianLocallyLinearEmbedding, LaplacianEigenmaps, LocalityPreservingProjections, DiffusionMap,
  Isomap, LandmarkIsomap, MultidimensionalScaling, LandmarkMultidimensionalScaling,
  StochasticProximityEmbedding, KernelPCA, PCA, RandomProjection,
  FactorAnalysis, tDistributedStochasticNeighborEmbedding, ManifoldSculpting, PassThru
}
 

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, stichwort::ParametersSet parameters)
 
std::string get_method_name (DimensionReductionMethod m)
 
std::string get_neighbors_method_name (const NeighborsMethod &m)
 
std::string get_eigen_method_name (const EigenMethod &m)
 

Variables

static const NeighborsMethod Brute ("Brute-force")
 
static const NeighborsMethod VpTree ("Vantage point tree")
 
static const NeighborsMethod CoverTree ("Cover tree")
 
static NeighborsMethod default_neighbors_method = CoverTree
 
static const EigenMethod Arpack ("Arpack")
 
static const EigenMethod Randomized ("Randomized")
 
static const EigenMethod Dense ("Dense")
 
static EigenMethod default_eigen_method = Arpack
 
static const ComputationStrategy HomogeneousCPUStrategy ("CPU")
 
static ComputationStrategy default_computation_strategy = HomogeneousCPUStrategy
 
const stichwort::ParametersForwarder kwargs
 

Typedef Documentation

◆ DenseDiagonalMatrix

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

dense diagonal matrix

Definition at line 27 of file types.hpp.

◆ DenseMatrix

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

dense matrix type (non-overridable)

Definition at line 23 of file types.hpp.

◆ DenseSelfAdjointEigenSolver

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

selfadjoint solver (non-overridable)

Definition at line 33 of file types.hpp.

◆ DenseSolver

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

dense solver (non-overridable)

Definition at line 35 of file types.hpp.

◆ DenseSymmetricMatrix

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

Definition at line 25 of file types.hpp.

◆ DenseVector

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

dense vector type (non-overridable)

Definition at line 21 of file types.hpp.

◆ IndexType

typedef int IndexType

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

Definition at line 19 of file types.hpp.

◆ Parameter

Definition at line 65 of file defines.hpp.

◆ ParametersSet

Definition at line 64 of file defines.hpp.

◆ ScalarType

typedef double ScalarType

default scalar value (can be overrided with TAPKEE_CUSTOM_INTERNAL_NUMTYPE define)

Definition at line 15 of file types.hpp.

◆ SparseMatrix

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

sparse matrix type (non-overridable)

Definition at line 31 of file types.hpp.

◆ SparseSolver

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

Definition at line 45 of file types.hpp.

◆ SparseWeightMatrix

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

sparse weight matrix type (non-overridable)

Definition at line 29 of file types.hpp.

Enumeration Type Documentation

◆ DimensionReductionMethod

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.

Function Documentation

◆ embed()

TapkeeOutput tapkee::embed ( RandomAccessIterator  begin,
RandomAccessIterator  end,
KernelCallback  kernel_callback,
DistanceCallback  distance_callback,
FeaturesCallback  features_callback,
stichwort::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.

◆ gaussian_random()

ScalarType tapkee::gaussian_random ( )

Definition at line 39 of file random.hpp.

◆ get_eigen_method_name()

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

Returns the name of the provided eigen method

Definition at line 48 of file naming.hpp.

◆ get_method_name()

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

Returns the name of the provided method

Definition at line 13 of file naming.hpp.

◆ get_neighbors_method_name()

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

Returns the name of the provided neighbors method

Definition at line 42 of file naming.hpp.

◆ random_shuffle()

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

Definition at line 58 of file random.hpp.

◆ uniform_random()

ScalarType tapkee::uniform_random ( )

Definition at line 30 of file random.hpp.

◆ uniform_random_index()

IndexType tapkee::uniform_random_index ( )

Definition at line 16 of file random.hpp.

◆ uniform_random_index_bounded()

IndexType tapkee::uniform_random_index_bounded ( IndexType  upper)

Definition at line 25 of file random.hpp.

Variable Documentation

◆ Arpack

const EigenMethod Arpack("Arpack")
static

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.

◆ Brute

const NeighborsMethod Brute("Brute-force")
static

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

◆ CoverTree

const NeighborsMethod CoverTree("Cover tree")
static

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

◆ default_computation_strategy

ComputationStrategy default_computation_strategy = HomogeneousCPUStrategy
static

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

◆ default_eigen_method

EigenMethod default_eigen_method = Arpack
static

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

◆ default_neighbors_method

NeighborsMethod default_neighbors_method = CoverTree
static

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

◆ Dense

const EigenMethod Dense("Dense")
static

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

◆ HomogeneousCPUStrategy

const ComputationStrategy HomogeneousCPUStrategy("CPU")
static

◆ kwargs

Definition at line 63 of file defines.hpp.

◆ Randomized

const EigenMethod Randomized("Randomized")
static

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

◆ VpTree

const NeighborsMethod VpTree("Vantage point tree")
static

Vantage point tree -based method.