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.

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.2.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.2-py3-none-any.whl (72.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for grease_embeddings-0.1.2.tar.gz
Algorithm Hash digest
SHA256 51deab50c44b30efeaa1b831ba5e3ad9ca13e8178d5796bf65f6d61e217db207
MD5 da6ed4a67193aaba4ee06e9c45b960e7
BLAKE2b-256 498f0d66836a88abf2a8cc8eeaaab9af1e27c52a240bbb5522c042c60ebba049

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for grease_embeddings-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e2052e7a3ce7b855fd5eee21bc1607c19c3aed5c1d3401850f500586257d1b94
MD5 991f9efafc442883fd4424d5b53a3a19
BLAKE2b-256 528645d77d3106520ffe76ff6154061742ece44a1b85f61638566c63008f1909

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