mlpack  master
Public Member Functions | Private Attributes | List of all members
mlpack::neighbor::QDAFN< MatType > Class Template Reference

Public Member Functions

 QDAFN (const size_t l, const size_t m)
 Construct the QDAFN object but do not train it. More...
 
 QDAFN (const MatType &referenceSet, const size_t l, const size_t m)
 Construct the QDAFN object with the given reference set (this is the set that will be searched). More...
 
const MatType & CandidateSet (const size_t t) const
 Get the candidate set for the given projection table. More...
 
MatType & CandidateSet (const size_t t)
 Modify the candidate set for the given projection table. Careful! More...
 
size_t NumProjections () const
 Get the number of projections. More...
 
void Search (const MatType &querySet, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &distances)
 Search for the k furthest neighbors of the given query set. More...
 
template<typename Archive >
void Serialize (Archive &ar, const unsigned int)
 Serialize the model. More...
 
void Train (const MatType &referenceSet, const size_t l=0, const size_t m=0)
 Train the QDAFN model on the given reference set, optionally setting new parameters for the number of projections/tables (l) and the number of elements stored for each projection/table (m). More...
 

Private Attributes

std::vector< MatType > candidateSet
 
size_t l
 The number of projections. More...
 
arma::mat lines
 The random lines we are projecting onto. Has l columns. More...
 
size_t m
 The number of elements to store for each projection. More...
 
arma::mat projections
 Projections of each point onto each random line. More...
 
arma::Mat< size_t > sIndices
 Indices of the points for each S. More...
 
arma::mat sValues
 Values of a_i * x for each point in S. More...
 

Detailed Description

template<typename MatType = arma::mat>
class mlpack::neighbor::QDAFN< MatType >

Definition at line 34 of file qdafn.hpp.

Constructor & Destructor Documentation

template<typename MatType = arma::mat>
mlpack::neighbor::QDAFN< MatType >::QDAFN ( const size_t  l,
const size_t  m 
)

Construct the QDAFN object but do not train it.

Be sure to call Train() before calling Search().

Parameters
lNumber of projections.
mNumber of elements to store for each projection.
template<typename MatType = arma::mat>
mlpack::neighbor::QDAFN< MatType >::QDAFN ( const MatType &  referenceSet,
const size_t  l,
const size_t  m 
)

Construct the QDAFN object with the given reference set (this is the set that will be searched).

Parameters
referenceSetSet of reference data.
lNumber of projections.
mNumber of elements to store for each projection.

Member Function Documentation

template<typename MatType = arma::mat>
const MatType& mlpack::neighbor::QDAFN< MatType >::CandidateSet ( const size_t  t) const
inline

Get the candidate set for the given projection table.

Definition at line 90 of file qdafn.hpp.

References mlpack::neighbor::QDAFN< MatType >::candidateSet.

template<typename MatType = arma::mat>
MatType& mlpack::neighbor::QDAFN< MatType >::CandidateSet ( const size_t  t)
inline

Modify the candidate set for the given projection table. Careful!

Definition at line 92 of file qdafn.hpp.

References mlpack::neighbor::QDAFN< MatType >::candidateSet.

template<typename MatType = arma::mat>
size_t mlpack::neighbor::QDAFN< MatType >::NumProjections ( ) const
inline

Get the number of projections.

Definition at line 87 of file qdafn.hpp.

References mlpack::neighbor::QDAFN< MatType >::candidateSet.

template<typename MatType = arma::mat>
void mlpack::neighbor::QDAFN< MatType >::Search ( const MatType &  querySet,
const size_t  k,
arma::Mat< size_t > &  neighbors,
arma::mat &  distances 
)

Search for the k furthest neighbors of the given query set.

(The query set can contain just one point, that is okay.) The results will be stored in the given neighbors and distances matrices, in the same format as the mlpack NeighborSearch and LSHSearch classes.

template<typename MatType = arma::mat>
template<typename Archive >
void mlpack::neighbor::QDAFN< MatType >::Serialize ( Archive &  ar,
const unsigned  int 
)

Serialize the model.

template<typename MatType = arma::mat>
void mlpack::neighbor::QDAFN< MatType >::Train ( const MatType &  referenceSet,
const size_t  l = 0,
const size_t  m = 0 
)

Train the QDAFN model on the given reference set, optionally setting new parameters for the number of projections/tables (l) and the number of elements stored for each projection/table (m).

Parameters
referenceSetReference set to train on.
lNumber of projections.
mNumber of elements to store for each projection.

Member Data Documentation

template<typename MatType = arma::mat>
std::vector<MatType> mlpack::neighbor::QDAFN< MatType >::candidateSet
private
template<typename MatType = arma::mat>
size_t mlpack::neighbor::QDAFN< MatType >::l
private

The number of projections.

Definition at line 96 of file qdafn.hpp.

template<typename MatType = arma::mat>
arma::mat mlpack::neighbor::QDAFN< MatType >::lines
private

The random lines we are projecting onto. Has l columns.

Definition at line 100 of file qdafn.hpp.

template<typename MatType = arma::mat>
size_t mlpack::neighbor::QDAFN< MatType >::m
private

The number of elements to store for each projection.

Definition at line 98 of file qdafn.hpp.

template<typename MatType = arma::mat>
arma::mat mlpack::neighbor::QDAFN< MatType >::projections
private

Projections of each point onto each random line.

Definition at line 102 of file qdafn.hpp.

template<typename MatType = arma::mat>
arma::Mat<size_t> mlpack::neighbor::QDAFN< MatType >::sIndices
private

Indices of the points for each S.

Definition at line 105 of file qdafn.hpp.

template<typename MatType = arma::mat>
arma::mat mlpack::neighbor::QDAFN< MatType >::sValues
private

Values of a_i * x for each point in S.

Definition at line 107 of file qdafn.hpp.


The documentation for this class was generated from the following file: