Skip to main content

jaxsne

build pypi docs

A library for doing dimensionality reduction in different metric spaces, or using different distributions.

In addition to regular t-SNE for MNIST

tsne

this can also be used to embed points on the sphere

ssne

or even into hierarchical hyperbolic space

psne

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

Releases are cut by manually dispatching the release workflow, which gates on CI, builds, and publishes to PyPI via trusted publishing.

Tasks

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jaxsne-0.3.1.tar.gz (599.6 kB view details)

Uploaded Source

Built Distribution

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

jaxsne-0.3.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file jaxsne-0.3.1.tar.gz.

File metadata

  • Download URL: jaxsne-0.3.1.tar.gz
  • Upload date:
  • Size: 599.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jaxsne-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e400d005aaa0aebee29a8ad72af7db2396882f44061580c612e33c6aedfe49ec
MD5 c99780f485369e8c308a2e65ce21285a
BLAKE2b-256 892e61ffc749e3a0e588fadd373f2bf78efa28f9e5c154de36fdcc1657755166

See more details on using hashes here.

Provenance

The following attestation bundles were made for jaxsne-0.3.1.tar.gz:

Publisher: release.yml on hafaio/jaxsne

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jaxsne-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: jaxsne-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jaxsne-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 daa4c53532c49e62626e4e2fba746b7f6ed8be9e3191d1294f5ae67fe1826591
MD5 a2de94abeb3da9bad1533a483b9cd725
BLAKE2b-256 2f6d538041af8e785d2582dac0ac5951a7ddc67627d76d79d44d3241abbf9c10

See more details on using hashes here.

Provenance

The following attestation bundles were made for jaxsne-0.3.1-py3-none-any.whl:

Publisher: release.yml on hafaio/jaxsne

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page