24 #ifndef MLPACK_METHODS_APPROX_KFN_QDAFN_HPP 25 #define MLPACK_METHODS_APPROX_KFN_QDAFN_HPP 33 template<
typename MatType = arma::mat>
44 QDAFN(
const size_t l,
const size_t m);
54 QDAFN(
const MatType& referenceSet,
67 void Train(
const MatType& referenceSet,
77 void Search(
const MatType& querySet,
79 arma::Mat<size_t>& neighbors,
80 arma::mat& distances);
83 template<
typename Archive>
84 void Serialize(Archive& ar,
const unsigned int );
117 #include "qdafn_impl.hpp" const MatType & CandidateSet(const size_t t) const
Get the candidate set for the given projection table.
Linear algebra utility functions, generally performed on matrices or vectors.
MatType & CandidateSet(const size_t t)
Modify the candidate set for the given projection table. Careful!
size_t m
The number of elements to store for each projection.
arma::mat lines
The random lines we are projecting onto. Has l columns.
The core includes that mlpack expects; standard C++ includes and Armadillo.
QDAFN(const size_t l, const size_t m)
Construct the QDAFN object but do not train it.
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.
arma::Mat< size_t > sIndices
Indices of the points for each S.
size_t NumProjections() const
Get the number of projections.
std::vector< MatType > candidateSet
void Serialize(Archive &ar, const unsigned int)
Serialize the model.
arma::mat sValues
Values of a_i * x for each point in S.
size_t l
The number of projections.
arma::mat projections
Projections of each point onto each random line.
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...