Skip to main content

A library for doing dimensionality reduction with different curvature

Project description

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

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

jaxsne-0.2.0.tar.gz (564.2 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.2.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

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

Hashes for jaxsne-0.2.0.tar.gz
Algorithm Hash digest
SHA256 418ae82a186eca5f316515907d6bb435f1ac9bf4aeaeeb468356cc1531cecf60
MD5 6d0d86867b3b2cd83deafb8352c059c2
BLAKE2b-256 36063fec8562a76d913aca1d729b96f53dae1b43ed44435aee7284fde8e052d2

See more details on using hashes here.

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

Hashes for jaxsne-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb49348c47d417835441ee4ac59a4b8f49ef458841fbeae04b6c3cd0912dd799
MD5 8a5676ffc9540a4bdc6ef42deee70de2
BLAKE2b-256 75873b15d44868d2543a0b32310fa2c8545ef4609c2af8582ebdcfdff636be5f

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