Skip to main content

Small linear-algebra helpers (distance, geometric median, cosine, nannorm) — standalone module from the SciTeX ecosystem

Project description

scitex-linalg

Small linear-algebra helpers extracted from the SciTeX ecosystem as a standalone package.

Install

pip install scitex-linalg            # core (numpy/scipy/sympy)
pip install "scitex-linalg[torch]"   # + geometric_median (torch + geom-median)

API

import scitex_linalg as sxl

sxl.euclidean_distance(u, v, axis=0)      # element-wise Euclidean distance
sxl.cdist(u, v)                           # pairwise distances
sxl.edist(u, v)                           # alias for cdist
sxl.cosine(v1, v2)                        # cosine similarity (NaN-safe)
sxl.nannorm(v, axis=-1)                   # NaN-aware vector norm
sxl.rebase_a_vec(v, v_base)               # project v onto v_base basis
sxl.three_line_lengths_to_coords(a, b, c) # triangle side lengths -> 2-D coords
sxl.geometric_median(xx, dim=-1)          # torch geometric median (requires [torch] extra)

Status

Standalone fork of scitex.linalg — intended to remain importable as scitex.linalg via the SciTeX umbrella package's bridge module. Decorators (numpy_fn, torch_fn, wrap) are vendored under _vendor_decorators/ to keep the package free of scitex.* runtime deps; when scitex-decorators is split out, those will be replaced with a direct dependency.

License

AGPL-3.0-only (see LICENSE).

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

scitex_linalg-0.1.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

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

scitex_linalg-0.1.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scitex_linalg-0.1.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for scitex_linalg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d4e80050b7edb856294f407f467396ce4a8bb2584b96cac19726e5333560e2e0
MD5 bb60043497639efda7f6b6955ec2a627
BLAKE2b-256 1a19a6b11d3c487196342bf6a409d1c629e9a5e95e91132fe061c178a2f48f4a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scitex_linalg-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for scitex_linalg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4ea8883c391dd2bd0a104766ea5563dfb1c2fe86a307df98876b502e650be22
MD5 fa0042f261aadc38136d3efa1e95f34b
BLAKE2b-256 92a59d3585d77185fa9d372d4012f4dc8b9829e2eb39c84cd24b84b3a786179f

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