Skip to main content

GPU-accelerated intrinsic dimension estimators in PyTorch (port of scikit-dimension).

Project description

torchid

GPU-accelerated intrinsic dimension estimators in PyTorch. A port of scikit-dimension with batched/vectorized implementations and CUDA support.

Status: in-progress port. See CHECKLIST.md for progress.

Why

scikit-dimension is the reference library for intrinsic dimension (ID) estimation but is CPU-only and relies heavily on per-point Python loops. torchid re-implements every estimator using batched torch ops so the same methods run 10–200× faster on GPU while producing outputs that match the reference library within documented tolerances.

Install

pip install torchid

For a CUDA-capable install, pick the PyTorch wheel that matches your driver, e.g.:

pip install torch --index-url https://download.pytorch.org/whl/cu128
pip install torchid

For running parity tests against scikit-dimension from a clone:

uv sync --group validation

Usage

import torch
from torchid.estimators import lPCA

X = torch.randn(10_000, 50, device="cuda")
est = lPCA().fit(X)
print(est.dimension_)

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

torchid-0.3.0.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

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

torchid-0.3.0-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: torchid-0.3.0.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for torchid-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3907f93b777466816668bf70f855edc1b5bac4f911e3be7380b814e6620351fb
MD5 9206e7b421b5edb9e38cc0cbaf1e8767
BLAKE2b-256 999795c4851f1cfc8a887a083e8dff793293aa36b9918b460f98446311bc79f5

See more details on using hashes here.

File details

Details for the file torchid-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: torchid-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for torchid-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 35e57766f249db418beb82df3004abace64d576d9f8f050c63e8b92e3386663e
MD5 96446ad616b07caf48c8a4f0f7cc1d74
BLAKE2b-256 456c75ffc53cfdbea2cabc98a7c78c8cb49c2d21e2b18616b099650929cfc7ba

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