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

rm -rf dist
uv build
uv publish --username __token__

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.0.tar.gz (641.8 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.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jaxsne-0.3.0.tar.gz
  • Upload date:
  • Size: 641.8 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.0.tar.gz
Algorithm Hash digest
SHA256 08a371408a042f85f9ff06a62471649c5bfae5e629fcffaae8dbc2a564ad24c7
MD5 d6fddb64eb075bae457f0d053a6fba20
BLAKE2b-256 755496175238ac5d4a5e8bf7811afa7224dcbf79065734a5775e9bc794a6128e

See more details on using hashes here.

Provenance

The following attestation bundles were made for jaxsne-0.3.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: jaxsne-0.3.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3daf7a7556e957a667cb23d62bcd1c151cf8d114ee5df99a41216ab480d57c2d
MD5 401bca56cd9f3129d3d1e7382cfa57ee
BLAKE2b-256 3760ccec9cd21a8b0735c18a1646a385dbcf3bfc8393c5e2b3bf9e35843c34aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for jaxsne-0.3.0-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