Skip to main content

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

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
uv run ruff check
uv run mypy jaxsne
uv run pytest

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.1.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

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

jaxsne-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jaxsne-0.1.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.28

File hashes

Hashes for jaxsne-0.1.0.tar.gz
Algorithm Hash digest
SHA256 662d0cba792157631d8ec64a6bab89309cd6866e6d1432561b420b8cbacd3563
MD5 230c38434c0439b503b7a8573c1932fd
BLAKE2b-256 0a8c18eb463b5a2db8a0740eb77196a3440b6980872273eed45435eb688440cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jaxsne-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.28

File hashes

Hashes for jaxsne-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60e026d24bd34e1de7ea11abd25d8eae7d4a2fcb80d1be2c9ef6ebea504c029a
MD5 30f7d6efa6baf870ea35066f80c87791
BLAKE2b-256 b1629c733c1f7cb07022dec3760f2cccb7c3a956c7c8c19bad555a5bb7ff52c3

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