Generalizable and Efficient Approximate Spectral Embeddings
Project description
GrEASE
This is the official PyTorch implementation of GrEASE.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file grease_embeddings-0.1.4.tar.gz.
File metadata
- Download URL: grease_embeddings-0.1.4.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da04d4e745fab19a0d915a381c2db781cd2e77a0ba7bf9aba654d2df7d69f3e5
|
|
| MD5 |
a35cc4cdca10b49986546e677ea849b0
|
|
| BLAKE2b-256 |
87fbcb908b66e8360e8764d71512a674f5d6169821d9d6431f06d438c0e99be2
|
File details
Details for the file grease_embeddings-0.1.4-py3-none-any.whl.
File metadata
- Download URL: grease_embeddings-0.1.4-py3-none-any.whl
- Upload date:
- Size: 72.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c100992e2f580e18dc764966db61d28edd93740b420c4332cf7a1b04a109ae5
|
|
| MD5 |
9b5430981820e2cd54703986c806f1a4
|
|
| BLAKE2b-256 |
97eb1f04c3388de078864f39ed68abe73f036a6e5b2595923fe76a3fa8676683
|