Functions | |
void | find_ab (const raft::handle_t &handle, UMAPParams *params) |
std::unique_ptr< raft::sparse::COO< float, int > > | get_graph (const raft::handle_t &handle, float *X, float *y, int n, int d, int64_t *knn_indices, float *knn_dists, UMAPParams *params) |
void | refine (const raft::handle_t &handle, float *X, int n, int d, raft::sparse::COO< float, int > *graph, UMAPParams *params, float *embeddings) |
void | init_and_refine (const raft::handle_t &handle, float *X, int n, int d, raft::sparse::COO< float, int > *graph, UMAPParams *params, float *embeddings) |
void | fit (const raft::handle_t &handle, float *X, float *y, int n, int d, int64_t *knn_indices, float *knn_dists, UMAPParams *params, float *embeddings, raft::sparse::COO< float, int > *graph) |
void | fit_sparse (const raft::handle_t &handle, int *indptr, int *indices, float *data, size_t nnz, float *y, int n, int d, int *knn_indices, float *knn_dists, UMAPParams *params, float *embeddings, raft::sparse::COO< float, int > *graph) |
void | transform (const raft::handle_t &handle, float *X, int n, int d, float *orig_X, int orig_n, float *embedding, int embedding_n, UMAPParams *params, float *transformed) |
void | transform_sparse (const raft::handle_t &handle, int *indptr, int *indices, float *data, size_t nnz, int n, int d, int *orig_x_indptr, int *orig_x_indices, float *orig_x_data, size_t orig_nnz, int orig_n, float *embedding, int embedding_n, UMAPParams *params, float *transformed) |
void ML::UMAP::find_ab | ( | const raft::handle_t & | handle, |
UMAPParams * | params | ||
) |
Returns the simplical set to be consumed by the ML::UMAP::refine function.
[in] | handle | raft::handle_t |
[out] | params | pointer to ML::UMAPParams object of which the a and b parameters will be updated |
void ML::UMAP::fit | ( | const raft::handle_t & | handle, |
float * | X, | ||
float * | y, | ||
int | n, | ||
int | d, | ||
int64_t * | knn_indices, | ||
float * | knn_dists, | ||
UMAPParams * | params, | ||
float * | embeddings, | ||
raft::sparse::COO< float, int > * | graph | ||
) |
Dense fit
[in] | handle | raft::handle_t |
[in] | X | pointer to input array |
[in] | y | pointer to labels array |
[in] | n | n_samples of input array |
[in] | d | n_features of input array |
[in] | knn_indices | pointer to knn_indices of input (optional) |
[in] | knn_dists | pointer to knn_dists of input (optional) |
[in] | params | pointer to ML::UMAPParams object |
[out] | embeddings | pointer to embedding produced through projection |
[out] | graph | pointer to fuzzy simplicial set graph |
void ML::UMAP::fit_sparse | ( | const raft::handle_t & | handle, |
int * | indptr, | ||
int * | indices, | ||
float * | data, | ||
size_t | nnz, | ||
float * | y, | ||
int | n, | ||
int | d, | ||
int * | knn_indices, | ||
float * | knn_dists, | ||
UMAPParams * | params, | ||
float * | embeddings, | ||
raft::sparse::COO< float, int > * | graph | ||
) |
Sparse fit
[in] | handle | raft::handle_t |
[in] | indptr | pointer to index pointer array of input array |
[in] | indices | pointer to index array of input array |
[in] | data | pointer to data array of input array |
[in] | nnz | pointer to data array of input array |
[in] | y | pointer to labels array |
[in] | n | n_samples of input array |
[in] | d | n_features of input array |
[in] | knn_indices | pointer to knn_indices of input (optional) |
[in] | knn_dists | pointer to knn_dists of input (optional) |
[in] | params | pointer to ML::UMAPParams object |
[out] | embeddings | pointer to embedding produced through projection |
[out] | graph | pointer to fuzzy simplicial set graph |
std::unique_ptr<raft::sparse::COO<float, int> > ML::UMAP::get_graph | ( | const raft::handle_t & | handle, |
float * | X, | ||
float * | y, | ||
int | n, | ||
int | d, | ||
int64_t * | knn_indices, | ||
float * | knn_dists, | ||
UMAPParams * | params | ||
) |
Returns the simplical set to be consumed by the ML::UMAP::refine function.
[in] | handle | raft::handle_t |
[in] | X | pointer to input array |
[in] | y | pointer to labels array |
[in] | n | n_samples of input array |
[in] | d | n_features of input array |
[in] | knn_indices | pointer to knn_indices (optional) |
[in] | knn_dists | pointer to knn_dists (optional) |
[in] | params | pointer to ML::UMAPParams object |
void ML::UMAP::init_and_refine | ( | const raft::handle_t & | handle, |
float * | X, | ||
int | n, | ||
int | d, | ||
raft::sparse::COO< float, int > * | graph, | ||
UMAPParams * | params, | ||
float * | embeddings | ||
) |
Initializes embeddings and performs a UMAP fit on them, which enables iterative fitting without callbacks.
[in] | handle | raft::handle_t |
[in] | X | pointer to input array |
[in] | n | n_samples of input array |
[in] | d | n_features of input array |
[in] | graph | pointer to raft::sparse::COO object computed using ML::UMAP::get_graph |
[in] | params | pointer to ML::UMAPParams object |
[out] | embeddings | pointer to current embedding with shape n * n_components, stores updated embeddings on executing refine |
void ML::UMAP::refine | ( | const raft::handle_t & | handle, |
float * | X, | ||
int | n, | ||
int | d, | ||
raft::sparse::COO< float, int > * | graph, | ||
UMAPParams * | params, | ||
float * | embeddings | ||
) |
Performs a UMAP fit on existing embeddings without reinitializing them, which enables iterative fitting without callbacks.
[in] | handle | raft::handle_t |
[in] | X | pointer to input array |
[in] | n | n_samples of input array |
[in] | d | n_features of input array |
[in] | graph | pointer to raft::sparse::COO object computed using ML::UMAP::get_graph |
[in] | params | pointer to ML::UMAPParams object |
[out] | embeddings | pointer to current embedding with shape n * n_components, stores updated embeddings on executing refine |
void ML::UMAP::transform | ( | const raft::handle_t & | handle, |
float * | X, | ||
int | n, | ||
int | d, | ||
float * | orig_X, | ||
int | orig_n, | ||
float * | embedding, | ||
int | embedding_n, | ||
UMAPParams * | params, | ||
float * | transformed | ||
) |
Dense transform
[in] | handle | raft::handle_t |
[in] | X | pointer to input array to be inferred |
[in] | n | n_samples of input array to be inferred |
[in] | d | n_features of input array to be inferred |
[in] | orig_X | pointer to original training array |
[in] | orig_n | number of rows in original training array |
[in] | embedding | pointer to embedding created during training |
[in] | embedding_n | number of rows in embedding created during training |
[in] | params | pointer to ML::UMAPParams object |
[out] | transformed | pointer to embedding produced through projection |
void ML::UMAP::transform_sparse | ( | const raft::handle_t & | handle, |
int * | indptr, | ||
int * | indices, | ||
float * | data, | ||
size_t | nnz, | ||
int | n, | ||
int | d, | ||
int * | orig_x_indptr, | ||
int * | orig_x_indices, | ||
float * | orig_x_data, | ||
size_t | orig_nnz, | ||
int | orig_n, | ||
float * | embedding, | ||
int | embedding_n, | ||
UMAPParams * | params, | ||
float * | transformed | ||
) |
Sparse transform
[in] | handle | raft::handle_t |
[in] | indptr | pointer to index pointer array of input array to be inferred |
[in] | indices | pointer to index array of input array to be inferred |
[in] | data | pointer to data array of input array to be inferred |
[in] | nnz | number of stored values of input array to be inferred |
[in] | n | n_samples of input array |
[in] | d | n_features of input array |
[in] | orig_x_indptr | pointer to index pointer array of original training array |
[in] | orig_x_indices | pointer to index array of original training array |
[in] | orig_x_data | pointer to data array of original training array |
[in] | orig_nnz | number of stored values of original training array |
[in] | orig_n | number of rows in original training array |
[in] | embedding | pointer to embedding created during training |
[in] | embedding_n | number of rows in embedding created during training |
[in] | params | pointer to ML::UMAPParams object |
[out] | transformed | pointer to embedding produced through projection |