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.1.tar.gz (22.1 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.1-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scitex_linalg-0.1.1.tar.gz
  • Upload date:
  • Size: 22.1 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.1.tar.gz
Algorithm Hash digest
SHA256 72984b1cb8c424d433034149e7fbd683c6ffe9535e1edaea69bd98916bd4210e
MD5 e7b357e73463ae50f8de30550376874c
BLAKE2b-256 e233f74d4652f322731952d8f736f3dc5ea4254c93d7fbc49cb54e19f10dab13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scitex_linalg-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b8784062e83fcfec460fbfea0b9cde20f637faff638da7985eb3cc1ec01a117
MD5 3e780c8b51da5855bc457dad4f828703
BLAKE2b-256 99ac7d21a8b9f370bd087cb3eeb22a55500db1b8f63948e7a4f587b96b3df25f

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