Skip to main content

Generalizable and Efficient Approximate Spectral Embeddings

Project description

GrEASE

This is the official PyTorch implementation of GrEASE from the paper "Generalizable Spectral Embedding with Applications to UMAP.

See out 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.3.tar.gz (27.7 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.3-py3-none-any.whl (72.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grease_embeddings-0.1.3.tar.gz
  • Upload date:
  • Size: 27.7 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.3.tar.gz
Algorithm Hash digest
SHA256 bfbdb089976a2918b5a05b4bd261614166682d3386281d6e8fb9903907e18771
MD5 6c388ba7ca2f8b6a040755c126b8fe65
BLAKE2b-256 a9ac7af8161b7783a18e5aa718fed6e3abc9f6c88d0186f21d68039cc34c8ff2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for grease_embeddings-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 671e00cd2a50a919c94090613a0d830d111798aed515a71932b47425cc0db30e
MD5 08bebd2106818be772213d2aa7f52163
BLAKE2b-256 98328f3c2657585b15d05e21aaba7b08172760d3275b866d8aa3c234c9b1a56a

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