Skip to main content

A JAX-based Dimension Reducer

Project description

DiRe - JAX

A new DImensionality REduction package written in JAX

We offer a new dimension reduction tool called DiRe - JAX that is benchmarked against the existing approaches: UMAP (original and Rapids.AI versions), and tSNE (Rapids.AI version)

Quick start

Do either

pip install dire-jax

if you need to install the main DiRe class only

pip install dire-jax[utils]

if you also need the benchmarking utilities.

Then, do the imports

from dire_jax import DiRe
from dire_jax.dire_utils import display_layout

and afterwards, for example, try this:

from sklearn.datasets import make_blobs

n_samples  = 100_000
n_features = 1_000
n_centers  = 12
features_blobs, labels_blobs = make_blobs(n_samples=n_samples, n_features=n_features, centers=n_centers, random_state=42)

reducer_blobs = DiRe(dimension=2,
                     n_neighbors=16,
                     init_embedding_type='pca',
                     max_iter_layout=32,
                     min_dist=1e-4,
                     spread=1.0,
                     cutoff=4.0,
                     n_sample_dirs=8,
                     sample_size=16,
                     neg_ratio=32,
                     verbose=False,)

_ = reducer_blobs.fit_transform(features_blobs)
reducer_blobs.visualize(labels=labels_blobs, point_size=4)

Working paper

Our working paper is available in the repository. Also, check out the Jupyter notebook with benchmarking results.

Benchmarking and utilities

In order to run the Jupyter notebook in the ./tests folder, you need to install some extras:

pip install dire-jax[utils]

This installation will give you access to the utilities (metrics and benchmarking routines) that are specifically implemented to be used together with DiRe. However, some of them rely on external packages (especially for persistent homology computations) that may have longer runtimes.

Contributing

Create a fork, contribute, and make a merge request. Thanks!

Acknowledgement

This work is supported by the Google Cloud Research Award number GCP19980904.

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

dire_jax-0.0.1.tar.gz (7.3 MB view details)

Uploaded Source

Built Distribution

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

dire_jax-0.0.1-py3-none-any.whl (7.3 MB view details)

Uploaded Python 3

File details

Details for the file dire_jax-0.0.1.tar.gz.

File metadata

  • Download URL: dire_jax-0.0.1.tar.gz
  • Upload date:
  • Size: 7.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for dire_jax-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c96062e6273c5ff1eac176de140f6323f9ddfaffa841d10f4ce3c2703b441dd3
MD5 82b9a8b45b0eacbce68fc85aa9ada544
BLAKE2b-256 090272f2b5f566cebe4e89ccb10e4a682ef668f2295c0628b20f836b474178c0

See more details on using hashes here.

File details

Details for the file dire_jax-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: dire_jax-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for dire_jax-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d7c94b8ec1d012037bdf4f4b8b7c63319b11c21d702691d21ef82ee2241e68b5
MD5 5a3eb5b0c25474f4211ea789b53ddd15
BLAKE2b-256 6925329d2950ff421c01e134651263e39bd33d900a12e59eca1b4be4c2d751f5

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