Functions
ML::KNN::opg Namespace Reference

Functions

void knn (raft::handle_t &handle, std::vector< Matrix::Data< int64_t > * > *out_I, std::vector< Matrix::floatData_t * > *out_D, std::vector< Matrix::floatData_t * > &idx_data, Matrix::PartDescriptor &idx_desc, std::vector< Matrix::floatData_t * > &query_data, Matrix::PartDescriptor &query_desc, bool rowMajorIndex, bool rowMajorQuery, int k, size_t batch_size, bool verbose)
 
void knn_classify (raft::handle_t &handle, std::vector< Matrix::Data< int > * > *out, std::vector< std::vector< float * >> *probas, std::vector< Matrix::floatData_t * > &idx_data, Matrix::PartDescriptor &idx_desc, std::vector< Matrix::floatData_t * > &query_data, Matrix::PartDescriptor &query_desc, std::vector< std::vector< int * >> &y, std::vector< int * > &uniq_labels, std::vector< int > &n_unique, bool rowMajorIndex=false, bool rowMajorQuery=false, bool probas_only=false, int k=10, size_t batch_size=1<< 15, bool verbose=false)
 
void knn_regress (raft::handle_t &handle, std::vector< Matrix::Data< float > * > *out, std::vector< Matrix::floatData_t * > &idx_data, Matrix::PartDescriptor &idx_desc, std::vector< Matrix::floatData_t * > &query_data, Matrix::PartDescriptor &query_desc, std::vector< std::vector< float * >> &y, bool rowMajorIndex, bool rowMajorQuery, int k, int n_outputs, size_t batch_size, bool verbose)
 

Function Documentation

◆ knn()

void ML::KNN::opg::knn ( raft::handle_t &  handle,
std::vector< Matrix::Data< int64_t > * > *  out_I,
std::vector< Matrix::floatData_t * > *  out_D,
std::vector< Matrix::floatData_t * > &  idx_data,
Matrix::PartDescriptor &  idx_desc,
std::vector< Matrix::floatData_t * > &  query_data,
Matrix::PartDescriptor &  query_desc,
bool  rowMajorIndex,
bool  rowMajorQuery,
int  k,
size_t  batch_size,
bool  verbose 
)

Performs a multi-node multi-GPU KNN.

Parameters
[in]handlethe raft::handle_t to use for managing resources
[out]out_Ivector of output index partitions. size should match the number of local input partitions.
[out]out_Dvector of output distance partitions. size should match the number of local input partitions.
[in]idx_datavector of local indices to query
[in]idx_descdescribes how the index partitions are distributed across the ranks.
[in]query_datavector of local query partitions
[in]query_descdescribes how the query partitions are distributed across the cluster.
[in]rowMajorIndexboolean indicating whether the index is row major.
[in]rowMajorQueryboolean indicating whether the query is row major.
[in]kthe number of neighbors to query
[in]batch_sizethe max number of rows to broadcast at a time
[in]verboseprint extra logging info

◆ knn_classify()

void ML::KNN::opg::knn_classify ( raft::handle_t &  handle,
std::vector< Matrix::Data< int > * > *  out,
std::vector< std::vector< float * >> *  probas,
std::vector< Matrix::floatData_t * > &  idx_data,
Matrix::PartDescriptor &  idx_desc,
std::vector< Matrix::floatData_t * > &  query_data,
Matrix::PartDescriptor &  query_desc,
std::vector< std::vector< int * >> &  y,
std::vector< int * > &  uniq_labels,
std::vector< int > &  n_unique,
bool  rowMajorIndex = false,
bool  rowMajorQuery = false,
bool  probas_only = false,
int  k = 10,
size_t  batch_size = 1<< 15,
bool  verbose = false 
)

Performs a multi-node multi-GPU KNN classify.

Parameters
[in]handlethe raft::handle_t to use for managing resources
[out]outvector of output labels partitions. size should match the number of local input partitions.
[in]probas(optional) pointer to a vector containing arrays of probabilities
[in]idx_datavector of local indices to query
[in]idx_descdescribes how the index partitions are distributed across the ranks.
[in]query_datavector of local query partitions
[in]query_descdescribes how the query partitions are distributed across the cluster.
[in]yvector of vector of label arrays. for multilabel classification, each element in the vector is a different "output" array of labels corresponding to the i'th output. size should match the number of local input partitions.
[in]uniq_labelsvector of the sorted unique labels for each array in y
[in]n_uniquevector of sizes for each array in uniq_labels
[in]rowMajorIndexboolean indicating whether the index is row major.
[in]rowMajorQueryboolean indicating whether the query is row major.
[in]probas_onlyreturn probas instead of performing complete knn_classify
[in]kthe number of neighbors to query
[in]batch_sizethe max number of rows to broadcast at a time
[in]verboseprint extra logging info

◆ knn_regress()

void ML::KNN::opg::knn_regress ( raft::handle_t &  handle,
std::vector< Matrix::Data< float > * > *  out,
std::vector< Matrix::floatData_t * > &  idx_data,
Matrix::PartDescriptor &  idx_desc,
std::vector< Matrix::floatData_t * > &  query_data,
Matrix::PartDescriptor &  query_desc,
std::vector< std::vector< float * >> &  y,
bool  rowMajorIndex,
bool  rowMajorQuery,
int  k,
int  n_outputs,
size_t  batch_size,
bool  verbose 
)

Performs a multi-node multi-GPU KNN regress.

Parameters
[in]handlethe raft::handle_t to use for managing resources
[out]outvector of output partitions. size should match the number of local input partitions.
[in]idx_datavector of local indices to query
[in]idx_descdescribes how the index partitions are distributed across the ranks.
[in]query_datavector of local query partitions
[in]query_descdescribes how the query partitions are distributed across the cluster.
[in]yvector of vector of output arrays. for multi-output regression, each element in the vector is a different "output" array corresponding to the i'th output. size should match the number of local input partitions.
[in]rowMajorIndexboolean indicating whether the index is row major.
[in]rowMajorQueryboolean indicating whether the query is row major.
[in]kthe number of neighbors to query
[in]n_outputsnumber of outputs
[in]batch_sizethe max number of rows to broadcast at a time
[in]verboseprint extra logging info