Differentiable computations of the signature and logsignature transforms, on both CPU and GPU.
Project description
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
Available for Python 2.7, Python 3.5, Python 3.6, Python 3.7 and Linux, Mac, Windows. Requires PyTorch 1.2.0 or 1.3.0.
Install via:
pip install signatory==<SIGNATORY_VERSION>.<TORCH_VERSION>
where <SIGNATORY_VERSION> is the version of Signatory you would like to download (the most recent version is 1.1.6) and <TORCH_VERSION> is the version of PyTorch you are using.
For example, if you are using PyTorch 1.3.0 and want Signatory 1.1.4, then you should run:
pip install signatory==1.1.4.1.3.0
Yes, this looks a bit odd. This is needed to work around limitations of PyTorch and pip.
Take care not to run pip install signatory, as this will likely download the wrong version.
After installation, just import signatory inside Python.
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
@article{signatory,
title={{Signatory: differentiable computations of the signature and logsignature transforms, on both CPU and GPU}},
author={Kidger, Patrick and Lyons, Terry},
journal={arXiv:2001.00706},
url={https://github.com/patrick-kidger/signatory},
year={2020}
}
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
Built Distributions
Hashes for signatory-1.1.6.1.3.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eb76a986c6296eb1d8c188d691882cdd4922cfce8d6c5e0f2c3fb459271892d |
|
MD5 | 8c52222c397ddd444f57d691e327a392 |
|
BLAKE2b-256 | 948a3cfb95ee42278984e1925e07fbba11fa8ad4d727fc60e7a8d73fe409690b |
Hashes for signatory-1.1.6.1.3.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e1112c744f6e12c5f6ddd7cbb8c7bddc06051bf49d663217d496d65c86cad22 |
|
MD5 | 75fd96398c456bccc95863ec693f683b |
|
BLAKE2b-256 | 0df073085c75d93296455f4392da8fcb3ab356fec6cff599cde5ef6dc07ab77b |
Hashes for signatory-1.1.6.1.3.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75f5784c2faf721ec5ae56fd6a48fc5e9e897aa0e51146e2672f0da8025eb74b |
|
MD5 | e0f3993ba63173c76f253575a6f635b9 |
|
BLAKE2b-256 | 6c1d37f76224e519c36df9327dbf4a58d5c7bc52f4dccbba26b3322b46e0af46 |
Hashes for signatory-1.1.6.1.3.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86b6d039c81237135d1b2a7f314b544817d26b64ad7d62b5ad71acf2303e248a |
|
MD5 | 049abec12990d3030a3e8974e13c6506 |
|
BLAKE2b-256 | ddce6f2f9da94a79104455a1a8762d5c87ebef36de8c7adfb286f0c8ee04f4c5 |
Hashes for signatory-1.1.6.1.3.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8103470b9be24880eb121b93e0d40fa7a9fbdfd51e58dd1989d8f83531585312 |
|
MD5 | 71641653dea15ed77b1ceaafb3124ede |
|
BLAKE2b-256 | a98eeffbee1db849a4edbdf5e92b2284a9113eb6adaaf52f2005ac3332cdd3b1 |
Hashes for signatory-1.1.6.1.3.0-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2b6be726d05075537871d1374cd0f01f876512103f3498429b250df02a4eb74 |
|
MD5 | ab5a0bf1c8e37771a966c2437280466f |
|
BLAKE2b-256 | 7359adf1446eace0a40aaf6ecf82eea9e29be70c1bb3a67654dd3075fc87e596 |
Hashes for signatory-1.1.6.1.3.0-cp27-cp27m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40e75c2a21327b742eae799127001bf251192b7e6c91e7fc24f9439a92ee6ee4 |
|
MD5 | 02868063f2db13f8828598fb0621e207 |
|
BLAKE2b-256 | 9ddd05b14315b15af6f94645d2ff3944594ee086165f69a2660b849b73d8c6d3 |