Skip to main content

Signatory

Differentiable computations of the signature and logsignature transforms, on both CPU and GPU.

What is the signature transform?

The signature transform is roughly analogous to the Fourier transform, in that it operates on a stream of data (often a time series). Whilst the Fourier transform extracts information about frequency, the signature transform extracts information about order and area. Furthermore (and unlike the Fourier transform), order and area represent all possible nonlinear effects: the signature transform is a universal nonlinearity, meaning that every continuous function of the input stream may be approximated arbitrary well by a linear function of its signature. If you’re doing machine learning then you probably understand why this is such a desirable property!

Besides this, the signature transform has many other nice properties – robustness to missing or irregularly sampled data; optional translation invariance; optional sampling invariance. Furthermore it can be used to encode certain physical quantities, and may be used for data compression.

Check out this for a primer on the use of the signature transform in machine learning, just as a feature transformation, and this for a more in-depth look at integrating the signature transform into neural networks.

Installation

pip install signatory==<SIGNATORY_VERSION>.<TORCH_VERSION> --no-cache-dir --force-reinstall

where <SIGNATORY_VERSION> is the version of Signatory you would like to download (the most recent version is 1.2.6) and <TORCH_VERSION> is the version of PyTorch you are using.

Available for Python 3.6, 3.7, 3.8 on Linux and Windows. Requires PyTorch 1.6.0, 1.7.0, or 1.7.1.

(If you need it, then previous versions of Signatory included support for older versions of Python, PyTorch, and MacOS, see here.)

After installation, just import signatory inside Python.

Take care not to run pip install signatory, as this will likely download the wrong version.

Example:

For example, if you are using PyTorch 1.7.1 and want Signatory 1.2.4, then you should run:

pip install signatory==1.2.4.1.7.1 --no-cache-dir --force-reinstall

Why you need to specify all of this:

Yes, this looks a bit odd. This is needed to work around limitations of PyTorch and pip.

The --no-cache-dir --force-reinstall flags are because pip doesn’t expect to need to care about versions quite as much as this, so it will sometimes erroneously use inappropriate caches if not told otherwise.

Installation from source is also possible; please consult the documentation. This also includes information on how to run the tests and benchmarks.

If you have any problems with installation then check the FAQ. If that doesn’t help then feel free to open an issue.

Documentation

The documentation is available here.

Example

Usage is straightforward. As a simple example,

import signatory
import torch
batch, stream, channels = 1, 10, 2
depth = 4
path = torch.rand(batch, stream, channels)
signature = signatory.signature(path, depth)
# signature is a PyTorch tensor

For further examples, see the documentation.

Citation

If you found this library useful in your research, please consider citing the paper.

@inproceedings{kidger2021signatory,
  title={{S}ignatory: differentiable computations of the signature and logsignature transforms, on both {CPU} and {GPU}},
  author={Kidger, Patrick and Lyons, Terry},
  booktitle={International Conference on Learning Representations},
  year={2021},
  note={\url{https://github.com/patrick-kidger/signatory}}
}

Metadata

Release files for signatory 1.2.6.1.9.0

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

Source distribution (sdist)

Source distribution for signatory 1.2.6.1.9.0
File Size Uploaded
signatory-1.2.6.1.9.0.tar.gz 62.8 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for signatory 1.2.6.1.9.0
File
signatory-1.2.6.1.9.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
signatory-1.2.6.1.9.0-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
signatory-1.2.6.1.9.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
signatory-1.2.6.1.9.0-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details

Total release size: 960.4 kB

Release files / signatory-1.2.6.1.9.0.tar.gz

Download URL signatory-1.2.6.1.9.0.tar.gz
Size 62.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c9ab17df6286688c1c7b12c0e906031a1fe7681dfca551876c1ff616e12807d8
BLAKE2b-256 checksum
How to use checksums
f560b88949987377607876794e6b37351521148a658317b0bda422921d803ce7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.0

Release files / signatory-1.2.6.1.9.0-cp39-cp39-win_amd64.whl

Download URL signatory-1.2.6.1.9.0-cp39-cp39-win_amd64.whl
Size 223.6 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
9e7dc939064ab7b7576450585cdb3fac2d22adb507bc80e87e1acded2d248b53
BLAKE2b-256 checksum
How to use checksums
4c457e6a18fc63ea1d73223033dab8c14ce1e2f2eadad8d06313b673fc5d03bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

Release files / signatory-1.2.6.1.9.0-cp38-cp38-win_amd64.whl

Download URL signatory-1.2.6.1.9.0-cp38-cp38-win_amd64.whl
Size 223.6 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
8c423539c676fb777c7de094b0fd9b97d54eb063dc507d12ec02e48709a0f96b
BLAKE2b-256 checksum
How to use checksums
97a15feae588f73fd68fec2e730e42143e5134a8a081b6955a14164f2ad06934
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.2

Release files / signatory-1.2.6.1.9.0-cp37-cp37m-win_amd64.whl

Download URL signatory-1.2.6.1.9.0-cp37-cp37m-win_amd64.whl
Size 225.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
8ce39d1f7712fd6d8c6b0c6d10c225345dd71fd2a97cf81306c7b93b8a9d671d
BLAKE2b-256 checksum
How to use checksums
022c8da4ec48725b40703f05faea25aaf49efea49ffdd7556145923388234dcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.0

Release files / signatory-1.2.6.1.9.0-cp36-cp36m-win_amd64.whl

Download URL signatory-1.2.6.1.9.0-cp36-cp36m-win_amd64.whl
Size 225.2 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
f29f3f7a95881f053074481c6d0dbddb5720dae53b4402874a2b6579cb07861a
BLAKE2b-256 checksum
How to use checksums
82ae5844e9109fed61dc564f69303b77b911c19bdc2ce0235c6c89d3ddb3c4d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.9

Release history Release notifications | RSS feed

This release

1.2.6.1.9.0 This release

5 release files

1.1.3

8 release files

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.2.0

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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