A library for doing dimensionality reduction with different curvature
Project description
jaxsne
A library for doing dimensionality reduction in different metric spaces, or using different distributions.
In addition to regular t-SNE for MNIST
this can also be used to embed points on the sphere
or even into hierarchical hyperbolic space
The downside is that this is generally less performant than the t-SNE provided by scikit-learn, so should only be used if you want to tweak the metrics or measures.
Installation
pip install jaxsne
Basic Usage
import jaxsne
data = ... # n x d
reduced = jaxsne.sne(data)
# or
reduced = jaxsne.scaling(data)
Advanced Usage
import jaxsne
import jax
from jax import Array
from jax import numpy as jnp
@jax.jit
def manhattan(left: Array, right: Array) -> Array:
return jnp.abs(left - right).sum(-1)
data = ... # n x d
reduced = jaxsne.sne(data, in_metric=manhattan, out_metric=manhattan)
Development
uv run ruff format --check
uv run ruff check
uv run pyright
uv run pytest
Publishing
rm -rf dist
uv build
uv publish --username __token__
Tasks
- Extend to Barnes-Hut-SNE
Project details
Release history Release notifications | RSS feed
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 jaxsne-0.2.0.tar.gz.
File metadata
- Download URL: jaxsne-0.2.0.tar.gz
- Upload date:
- Size: 564.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.28
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
418ae82a186eca5f316515907d6bb435f1ac9bf4aeaeeb468356cc1531cecf60
|
|
| MD5 |
6d0d86867b3b2cd83deafb8352c059c2
|
|
| BLAKE2b-256 |
36063fec8562a76d913aca1d729b96f53dae1b43ed44435aee7284fde8e052d2
|
File details
Details for the file jaxsne-0.2.0-py3-none-any.whl.
File metadata
- Download URL: jaxsne-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.28
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb49348c47d417835441ee4ac59a4b8f49ef458841fbeae04b6c3cd0912dd799
|
|
| MD5 |
8a5676ffc9540a4bdc6ef42deee70de2
|
|
| BLAKE2b-256 |
75873b15d44868d2543a0b32310fa2c8545ef4609c2af8582ebdcfdff636be5f
|