umappp
A C++ library for UMAP
Loading...
Searching...
No Matches
Public Member Functions | List of all members
umappp::Status< Index_, Float_ > Class Template Reference

Status of the UMAP optimization iterations. More...

#include <Status.hpp>

Public Member Functions

int num_dimensions () const
 
const Float_embedding () const
 
void set_embedding (Float_ *ptr, bool copy=true)
 
int epoch () const
 
int num_epochs () const
 
size_t num_observations () const
 
void run (int epoch_limit=0)
 

Detailed Description

template<typename Index_, typename Float_>
class umappp::Status< Index_, Float_ >

Status of the UMAP optimization iterations.

Template Parameters
Index_Integer type of the neighbor indices.
Float_Floating-point type for the distances.

Instances of this class should not be constructed directly, but instead returned by initialize().

Member Function Documentation

◆ embedding()

const Float_ * umappp::Status< Index_, Float_ >::embedding ( ) const
inline
Returns
Pointer to an array containing the embeddings after the specified number of epochs. This is a column-major matrix where rows are dimensions (num_dimensions()) and columns are observations (num_observations()).

◆ epoch()

int umappp::Status< Index_, Float_ >::epoch ( ) const
inline
Returns
Current epoch.

◆ num_dimensions()

int umappp::Status< Index_, Float_ >::num_dimensions ( ) const
inline
Returns
Number of dimensions of the embedding.

◆ num_epochs()

int umappp::Status< Index_, Float_ >::num_epochs ( ) const
inline
Returns
Total number of epochs. This is typically determined by the value of Options::max_epochs used in initialize().

◆ num_observations()

size_t umappp::Status< Index_, Float_ >::num_observations ( ) const
inline
Returns
The number of observations in the dataset.

◆ run()

void umappp::Status< Index_, Float_ >::run ( int  epoch_limit = 0)
inline

The status of the algorithm and the coordinates in embedding() are updated to the specified number of epochs.

Parameters
epoch_limitNumber of epochs to run to. The actual number of epochs performed is equal to the difference between epoch_limit and the current number of epochs in epoch(). epoch_limit should be not less than epoch() and be no greater than the maximum number of epochs specified in max_epochs(). If zero, defaults to the maximum number of epochs.

◆ set_embedding()

void umappp::Status< Index_, Float_ >::set_embedding ( Float_ ptr,
bool  copy = true 
)
inline
Parameters
ptrPointer to an array as described in embedding().
copyWhether the contents of the previous array should be copied into ptr.

By default, the Status object will operate on embeddings in an array specified at its own construction time. This method will change the embedding array for an existing Status object, which can be helpful in some situations, e.g., to clone a Status object and to store its embeddings in a different array than the object.

The contents of the new array in ptr should be the same as the array that it replaces, as run() will continue the iteration from the coordinates inside the array. This is enforced by default when copy = true, but if the supplied ptr already contains a copy, the caller may set copy = false to avoid extra work


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