GPU-accelerated library for scalable and efficient differentiable path signature computations.
Project description
pathsig
pathsig is a GPU-accelerated library for differentiable signature and log-signature computations. It offers greater flexibility through projections and windowing, and achieves ~4–10× speedups for training (forward + backward) and ~10–30× speedups for forward-only evaluation in our benchmarks.
Documentation can be found at https://pathsig.readthedocs.io, and the accompanying paper is available on arXiv .
Installation
pip install pathsig
Quickstart
The example below computes truncated, windowed, and projected signatures on a CUDA tensor. Log-signatures are computed analogously, typically with a suitable projection (see the documentation).
import torch
import pathsig
x = torch.randn(32, 128, 8, device="cuda", dtype=torch.float32)
# Truncated signature
sig = pathsig.Signature(depth=4)
y = sig(x) # (B, D)
# Windowed signature
windows = torch.tensor([[0, 32], [32, 64]], device="cuda") # (W, 2)
sig = pathsig.Signature(depth=4, windows=windows)
y = sig(x) # (B, W, D)
# Signature with a word projection
proj = pathsig.projections.words(
words=[(0, 1), (2, 2, 3)],
depth=4,
path_dim=8,
full_levels=(1,),
)
sig = pathsig.Signature(depth=4, projection=proj)
y = sig(x) # (B, proj.sig_size)
License and citation
This project is licensed under the MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pathsig-0.2.0.tar.gz.
File metadata
- Download URL: pathsig-0.2.0.tar.gz
- Upload date:
- Size: 32.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90c6106de0a3d8411ca1a1a0888bcf9b5a7f861842f713e3458202aa3e6d2b8b
|
|
| MD5 |
45fa34d3f228dedf441e5191beb42215
|
|
| BLAKE2b-256 |
403ac3aabab7b614834f9f59ad3aaa52d57c54cd6defa216c1401d63d9b633fb
|