Skip to main content

Generalizable and Efficient Approximate Spectral Embeddings

Project description

GrEASE

This is the official PyTorch implementation of GrEASE: Generalizable and Efficient Approximate Spectral Embedding.

See our GitHub repository for more information.

The main application of GrEASE is NUMAP, a generalizable version of UMAP. The code for NUMAP can be found here.

Installation

To install the package, simply use the following command:

pip install grease-embeddings

Usage

The basic functionality is quite intuitive and easy to use, e.g.,

from grease import GrEASE

grease = GrEASE(n_components=10)  # n_components is the number of dimensions in the low-dimensional representation
grease.fit(X)  # X is the dataset and it should be a torch.Tensor
X_reduced = grease.transfrom(X)  # Get the low-dimensional representation of the dataset
Y_reduced = grease.transform(Y)  # Get the low-dimensional representation of a test dataset

You can read the code docs for more information and functionalities.

Out of many applications, GrEASE can be used for generalizable Fiedler vector and value approximation, and Diffusion Maps approximation. The following is examples of how to use GrEASE for these applications:

Fiedler vector and value approximation

from grease import GrEASE

grease = GrEASE(n_components=1)
fiedlerVector = grease.fit_transform(X)
fiedlerValue = grease.get_eigenvalues()

Diffusion Maps approximation

from grease import GrEASE

grease = GrEASE(n_components=10)
diffusionMaps = grease.fit_transform(X, t=5)  # t is the diffusion time

Running examples

In order to run the model on the moon dataset, you can either run the file, or using the command-line command:
python -m examples.reduce_moon
This will run the model on the moon dataset and plot the results.

The same can be done for the circles dataset:
python -m examples.reduce_circles

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grease_embeddings-0.1.5.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grease_embeddings-0.1.5-py3-none-any.whl (72.2 kB view details)

Uploaded Python 3

File details

Details for the file grease_embeddings-0.1.5.tar.gz.

File metadata

  • Download URL: grease_embeddings-0.1.5.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for grease_embeddings-0.1.5.tar.gz
Algorithm Hash digest
SHA256 6abc724061dc630bee309df6cac24d37ac710be904f4ced7b0e3cc5becbcf088
MD5 9e5d96d80e75a38c9916a15b7fa30595
BLAKE2b-256 8322a8c2b0661375c4f334d17bb85edd016ed1d5f57fd6085ddf3351532ef1ff

See more details on using hashes here.

File details

Details for the file grease_embeddings-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for grease_embeddings-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8526d2257612ac71937e56831b7214e9d0a11d2bb1a9beb6ad0bfb450804b962
MD5 fbb621982824c6a0421a4706997394bb
BLAKE2b-256 ef6ad4e6ffabb818425705b4a88725fb1e5d18eb11869d6e44b3a1addd8766b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page