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 are signatures?
If you’re reading this then it’s probably because you already know what the signature transform is, and are looking to use it in your project. But in case you’ve stumbled across this and are curious what this ‘signature’ thing is…
The signature transform is a transformation that takes in a stream of data (often a time series), and returns a collection of statistics about that stream of data, called the signature. This collection of statistics determines the path essentially uniquely. Importantly, the signature is rich enough that every continuous function of the input stream may be approximated arbitrarily well by a linear function of its signature; the signature transform is what we call a universal nonlinearity. If you’re doing machine learning then you probably understand why this is such a desirable property!
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.4) 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)
For further examples, see the documentation.
Citation
If you found this library useful in your research, please consider citing
@misc{signatory,
title={{Signatory: differentiable computations of the signature and logsignature transforms, on both CPU and GPU}},
author={Kidger, Patrick},
note={\texttt{https://github.com/patrick-kidger/signatory}},
year={2019}
}
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.4.1.2.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c89bfae9f25d44e5a22a09b04f90551a5bf7c1a86e5347b5eadc4f7ebb2e5db0 |
|
MD5 | af4e6b7e6d9d73f7989f29dc0333177c |
|
BLAKE2b-256 | d2e87eeda54f86eee633db57f65c5e5d2e8de06770bf2edfbd0a14c92053b884 |
Hashes for signatory-1.1.4.1.2.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5818e45fab3bd47ce44e68562b608777ed7ae598d19b4d358507d45f824f8a50 |
|
MD5 | 5a649785f42b0d78510a52dccd23f47c |
|
BLAKE2b-256 | ab7e0f080caeb0d0bca640533a3e18846fddb26e3ae8a01a702514034a6ac730 |
Hashes for signatory-1.1.4.1.2.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17583f34758cad686c4ab1d6b6ca7436e3d08f7733f84869c14c0384c278f595 |
|
MD5 | ed18d41fc4151fe942fbbec726eef268 |
|
BLAKE2b-256 | 81842655afe9f915a752e18154395cb345d0ab1f32b4c28e1d87f15959ba0b00 |
Hashes for signatory-1.1.4.1.2.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f83ac7218fb8d59715844a5c570a966711a132c48a77d3cbcde561fe542e3d6 |
|
MD5 | a4c14861b2cd8de82bf7c2bf03f4aeda |
|
BLAKE2b-256 | 682a0f21acc5093303fdbd5451617dd023027d0603bcef5854a764fbbd2f37a3 |
Hashes for signatory-1.1.4.1.2.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22306c333a92978f8bc755df61ee2e09e675ab92ce75c00a9477485b59ac9444 |
|
MD5 | 1ba0cb39b86fe96e6bf6793fcfb2231e |
|
BLAKE2b-256 | 218d8f82fea6adf513a51bb2ddeb4b05775226cd1f2bbdb9d80964f11e7578c6 |
Hashes for signatory-1.1.4.1.2.0-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73cf6bc5e09e81a657e3f1bbfddacf805cdffb65f55aa810f437cfe722b14d39 |
|
MD5 | 932a9525891c13bce3e27c8cb63e5a17 |
|
BLAKE2b-256 | fa62e1b85a3c38f76427f02efa37243200286063f4b23d44425737395203b83a |
Hashes for signatory-1.1.4.1.2.0-cp27-cp27m-macosx_10_6_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ca88fc3e2134488d6795ddcb550b1568d178aa2eef6d6971653e2b4e64d8977 |
|
MD5 | 918e2d08b09c7800aeba0110dd6a7262 |
|
BLAKE2b-256 | a9dff5f100a4cb04165e9badf706475b65593ba8f0473d5d759967db3b16b0d9 |