FastMKSModel Class Reference

A utility struct to contain all the possible FastMKS models, for use by the mlpack_fastmks program. More...

Public Types

enum  KernelTypes
{
  LINEAR_KERNEL
,
  POLYNOMIAL_KERNEL
,
  COSINE_DISTANCE
,
  GAUSSIAN_KERNEL
,
  EPANECHNIKOV_KERNEL
,
  TRIANGULAR_KERNEL
,
  HYPTAN_KERNEL

}
 A list of all the kernels we support. More...

 

Public Member Functions

 FastMKSModel (const int kernelType=LINEAR_KERNEL)
 Create the FastMKSModel with the given kernel type. More...

 
 FastMKSModel (const FastMKSModel &other)
 Copy constructor. More...

 
 FastMKSModel (FastMKSModel &&other)
 Move constructor. More...

 
 ~FastMKSModel ()
 Clean memory. More...

 
template
<
typename
TKernelType
>
void BuildModel (util::Timers &timers, arma::mat &&referenceData, TKernelType &kernel, const bool singleMode, const bool naive, const double base)
 Build the model on the given reference set. More...

 
int KernelType () const
 Get the kernel type. More...

 
int & KernelType ()
 Modify the kernel type. More...

 
bool Naive () const
 Get whether or not naive search is used. More...

 
bool & Naive ()
 Set whether or not naive search is used. More...

 
FastMKSModeloperator= (const FastMKSModel &other)
 Copy assignment operator. More...

 
FastMKSModeloperator= (FastMKSModel &&other)
 Move assignment operator. More...

 
void Search (util::Timers &timers, const arma::mat &querySet, const size_t k, arma::Mat< size_t > &indices, arma::mat &kernels, const double base)
 Search with a different query set. More...

 
void Search (util::Timers &timers, const size_t k, arma::Mat< size_t > &indices, arma::mat &kernels)
 Search with the reference set as the query set. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const uint32_t)
 Serialize the model. More...

 
bool SingleMode () const
 Get whether or not single-tree search is used. More...

 
bool & SingleMode ()
 Set whether or not single-tree search is used. More...

 

Detailed Description

A utility struct to contain all the possible FastMKS models, for use by the mlpack_fastmks program.

Definition at line 34 of file fastmks_model.hpp.

Member Enumeration Documentation

◆ KernelTypes

A list of all the kernels we support.

Enumerator
LINEAR_KERNEL 
POLYNOMIAL_KERNEL 
COSINE_DISTANCE 
GAUSSIAN_KERNEL 
EPANECHNIKOV_KERNEL 
TRIANGULAR_KERNEL 
HYPTAN_KERNEL 

Definition at line 38 of file fastmks_model.hpp.

Constructor & Destructor Documentation

◆ FastMKSModel() [1/3]

FastMKSModel ( const int  kernelType = LINEAR_KERNEL)

Create the FastMKSModel with the given kernel type.

◆ FastMKSModel() [2/3]

FastMKSModel ( const FastMKSModel other)

Copy constructor.

◆ FastMKSModel() [3/3]

FastMKSModel ( FastMKSModel &&  other)

Move constructor.

◆ ~FastMKSModel()

Clean memory.

Member Function Documentation

◆ BuildModel()

void BuildModel ( util::Timers timers,
arma::mat &&  referenceData,
TKernelType &  kernel,
const bool  singleMode,
const bool  naive,
const double  base 
)

Build the model on the given reference set.

Make sure kernelType is equal to the correct entry in KernelTypes for the given KernelType class!

◆ KernelType() [1/2]

int KernelType ( ) const
inline

Get the kernel type.

Definition at line 94 of file fastmks_model.hpp.

◆ KernelType() [2/2]

int& KernelType ( )
inline

Modify the kernel type.

Definition at line 96 of file fastmks_model.hpp.

References FastMKSModel::Search(), and FastMKSModel::serialize().

◆ Naive() [1/2]

bool Naive ( ) const

Get whether or not naive search is used.

◆ Naive() [2/2]

bool& Naive ( )

Set whether or not naive search is used.

◆ operator=() [1/2]

FastMKSModel& operator= ( const FastMKSModel other)

Copy assignment operator.

◆ operator=() [2/2]

FastMKSModel& operator= ( FastMKSModel &&  other)

Move assignment operator.

◆ Search() [1/2]

void Search ( util::Timers timers,
const arma::mat &  querySet,
const size_t  k,
arma::Mat< size_t > &  indices,
arma::mat &  kernels,
const double  base 
)

Search with a different query set.

Parameters
querySetSet to search with.
kNumber of max-kernel candidates to search for.
indicesA matrix in which to store the indices of max-kernel candidates.
kernelsA matrix in which to store the max-kernel candidate kernel values.
baseBase to use for cover tree building (if in dual-tree search mode).

Referenced by FastMKSModel::KernelType().

◆ Search() [2/2]

void Search ( util::Timers timers,
const size_t  k,
arma::Mat< size_t > &  indices,
arma::mat &  kernels 
)

Search with the reference set as the query set.

Parameters
kNumber of max-kernel candidates to search for.
indicesA matrix in which to store the indices of max-kernel candidates.
kernelsA matrix in which to store the max-kernel candidate kernel values.

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t   
)

Serialize the model.

Referenced by FastMKSModel::KernelType().

◆ SingleMode() [1/2]

bool SingleMode ( ) const

Get whether or not single-tree search is used.

◆ SingleMode() [2/2]

bool& SingleMode ( )

Set whether or not single-tree search is used.


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-git/src/mlpack/methods/fastmks/fastmks_model.hpp