Skip to main content

tensorsig

tensorsig provides differentiable signature, log-signature, and offset-coded signature features for PyTorch.

The first release is being prepared. The public API may change between 0.x releases.

Installation

tensorsig requires Python 3.14 or newer and PyTorch 2.14 or newer.

Until the first PyPI release, install from a checkout of this repository:

python -m pip install .

After publication, install with python -m pip install tensorsig.

Quick start

import torch

from tensorsig.classical.signatures import log_signature, signature

path = torch.tensor(
    [[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [2.0, 1.0]]],
    dtype=torch.float64,
)

first_turn = path[:, :3]
sig = signature(first_turn, depth=2)
logsig = log_signature(first_turn, depth=2)

assert sig.shape == (1, 6)
assert logsig.shape == (1, 3)
torch.testing.assert_close(
    sig,
    torch.tensor([[1.0, 1.0, 0.5, 1.0, 0.0, 0.5]], dtype=path.dtype),
)
torch.testing.assert_close(
    logsig,
    torch.tensor([[1.0, 1.0, 0.5]], dtype=path.dtype),
)

Start with the practitioner guides to signatures and logsignatures. The complete callable surface is in the API reference. The hosted documentation will become available with the first release. Until then, use the local preview described under Development.

Choosing local features

Need Start with
Classical logsignatures after path lifts tensorsig.augmentations followed by classical.windows.WindowedLogSignature in torch.nn.Sequential
Signatures or logsignatures retaining local offset information offset_coded_signatures.plans.LocalRealization with a codes.OffsetCode
Scalar polynomials in physical increments offset_coded_signatures.plans.compile_polynomial
Apply a compiled local plan to a path offset_coded_signatures.layers.LocalFeatures or LocalLinear
Explicit quotient window algorithms on increment streams offset_coded_signatures.windows.WindowLogSignature

The offset-coded signatures guide shows these constructions and their input conventions. Offset-coded windows count increments; classical windows count points. Path augmentations are shared across both families and run before window extraction.

Citing

If you use this package in your research, please cite as follows:

@software{aune2026tensorsig,
  author    = {Aune, Erlend},
  title     = {tensorsig},
  version   = {0.1.0},
  year      = {2026},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.23886748},
  url       = {https://doi.org/10.5281/zenodo.23886748}
}
Aune, E. (2026). tensorsig (Version 0.1.0) [Computer software]. Zenodo.
https://doi.org/10.5281/zenodo.23886748

See CITATION.cff.

Development

The project uses uv and keeps its development environment in the committed uv.lock. Python requirements are defined in pyproject.toml.

uv sync --locked
uv run ruff check .
uv run ruff format --check .
uv run pytest -q

Generate and strictly build the complete HTML documentation with:

uv run python scripts/generate_docs.py

To build, start a local preview, and open it in your browser:

uv run python scripts/generate_docs.py --serve

The HTML site is written to site/. Stop the preview with Ctrl+C. After editing Python guides or docstrings, rerun the script to regenerate the documentation.

Validate a prepared release with scripts/release.sh --check X.Y.Z, then publish it from clean main with scripts/release.sh X.Y.Z. Keep the package version and CITATION.cff version aligned, and set date-released in CITATION.cff to the actual release date before running the release checks. GitHub Actions publishes to PyPI and deploys the documentation when the GitHub Release is published. The PyPI Trusted Publisher and GitHub Pages Actions source must be configured before the first release.

License

tensorsig is released under the MIT License.

Metadata

Release files for tensorsig 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tensorsig 0.1.1
File Size Uploaded Provenance Actions
tensorsig-0.1.1.tar.gz 155.9 kB With provenance Details for tensorsig-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tensorsig 0.1.1
File Interpreter ABI Platform Actions
tensorsig-0.1.1-py3-none-any.whl Python 3 none any Details for tensorsig-0.1.1-py3-none-any.whl

Total release size: 349.9 kB

Release files / tensorsig-0.1.1.tar.gz

Download URL tensorsig-0.1.1.tar.gz
Size 155.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0ebbc0e68c429734aaba5ca4a257dbe52be3710fa15f150202e6814020eb5cbb
BLAKE2b-256 checksum
How to use checksums
85181b184ddc0b62d93e2646a5700f0176188917227a88883521fd4a503190a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / tensorsig-0.1.1-py3-none-any.whl

Download URL tensorsig-0.1.1-py3-none-any.whl
Size 194.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7bb1f2d4b38df6f53817cb71f7adf2866f73f5acddd90b81db0ba0e3a30d1cd
BLAKE2b-256 checksum
How to use checksums
77de49aeea28843ae771d6680fdcb78eec1e917c17ecfe8947f18e5f9bc0b13d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for tensorsig 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tensorsig-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page