Skip to main content

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

Project description

torchid — intrinsic dimension estimation

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

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 100–2700× faster on GPU (measured on an NVIDIA H100, see BENCHMARKS.md) while producing outputs that match the reference library within documented tolerances.

Install

pip install "torchid[cpu]"   # CPU-only (faiss-cpu)
pip install "torchid[cuda]"  # GPU-enabled (faiss-cuda-cu128, manylinux_2_28+)

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

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

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.4.0.tar.gz (27.3 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.4.0-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: torchid-0.4.0.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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.4.0.tar.gz
Algorithm Hash digest
SHA256 2a48c8a7f4b11bc495f3e63f22c9b09ef30e2c5f93555e3f78986722ac07c463
MD5 f691c892982d6ca8bd4e1a9d2fd5c3f7
BLAKE2b-256 27a7cb4d5a769984d9aded6a779d6ecdd7e172224ae675af3180a0cf196034cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: torchid-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5aebbe19c4381a9fb38e2bac3f2e71b3ce50b30cf03ae65253a92981e666003b
MD5 da129326370a8b9a78bb2b8be7be7eee
BLAKE2b-256 ccaf086a1008be696190883531d1f07e25a96e6231eec49c17833e69ec6a77f6

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