Package: signatory
Differentiable computations of the signature and logsignature transforms, on both CPU and GPU.What is the signature transform?Thesignature transformis 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 aboutorderandarea. Furthermore (and unlike the Fourier transform), order and area represent all possible nonlinear effects: the signature transform is auniversal nonlinearity, meaning that every continuous function of the input stream may be approximated arbitrary well by alinearfunction 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 outthisfor a primer on the use of the signature transform in machine learning, just as a feature transformation, andthisfor a more in-depth look at integrating the signature transform into neural networks.Installationpipinstallsignatory==<SIGNATORY_VERSION>.<TORCH_VERSION>--no-cache-dir--force-reinstallwhere<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. RequiresPyTorch1.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, seehere.)After installation, justimport signatoryinside Python.Take carenotto runpip 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:pipinstallsignatory==1.2.4.1.7.1--no-cache-dir--force-reinstallWhy you need to specify all of this:Yes, this looks a bit odd. This is needed to work aroundlimitations of PyTorchandpip.The--no-cache-dir--force-reinstallflags are becausepipdoesn’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 thedocumentation. This also includes information on how to run the tests and benchmarks.If you have any problems with installation then check theFAQ. If that doesn’t help then feel free toopen an issue.DocumentationThe documentation is availablehere.ExampleUsage is straightforward. As a simple example,importsignatoryimporttorchbatch,stream,channels=1,10,2depth=4path=torch.rand(batch,stream,channels)signature=signatory.signature(path,depth)# signature is a PyTorch tensorFor further examples, see thedocumentation.CitationIf you found this library useful in your research, please consider citingthe 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}}}