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.2.0.tar.gz (28.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.2.0-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: torchid-0.2.0.tar.gz
  • Upload date:
  • Size: 28.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.2.0.tar.gz
Algorithm Hash digest
SHA256 fc4dad5148d29c58c76f178a08f94e5fa66d0b38b8bf105deaf3d1261c6f2e17
MD5 8d91d4e9780899c525d82724a71164da
BLAKE2b-256 e66a9d7c1cd952e6ea9c9053c0346a206c7cafa62c57e80f89eb937cc795b2bc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: torchid-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 35.9 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5a29d1e9813e2b39cb050eb7195386aac1d69f38be77e56957ff56a42d9db8b
MD5 af9863c099c667c78513f4ee7f46ced1
BLAKE2b-256 1ef3100f404135fc50d2d81b343e7fea55fb0f54f40a1a4bbaadbcce9cc0634c

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