Coder Social home page Coder Social logo

patrick-kidger / signatory Goto Github PK

View Code? Open in Web Editor NEW
250.0 12.0 30.0 1.44 MB

Differentiable computations of the signature and logsignature transforms, on both CPU and GPU. (ICLR 2021)

License: Apache License 2.0

C++ 100.00%
signature logsignature signatures logsignatures rough-paths machine-learning pytorch deep-learning deep-neural-networks

signatory's Introduction

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.7) and <TORCH_VERSION> is the version of PyTorch you are using.

Available for Python 3.7--3.9 on Linux and Windows. Requires PyTorch 1.8.0--1.11.0.

(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.11.0 and want Signatory 1.2.7, then you should run:

pip install signatory==1.2.7.1.11.0 --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}}
}

signatory's People

Contributors

afermanian avatar josephlmulligan avatar patrick-kidger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

signatory's Issues

Error installing signatory and torch simultaneously

Hi. I'm trying to install signatory, along torch with:

pip install -r requirements.txt

Being said requirements.txt:

torch==1.7.1
signatory==1.2.4.1.7.1

And I get the following error:

Collecting torch==1.7.1 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/90/4f/acf48b3a18a8f9223c6616647f0a011a5713a985336088d7c76f3a211374/torch-1.7.1-cp36-cp36m-manylinux1_x86_64.whl (776.8MB)
    100% |████████████████████████████████| 776.8MB 112kB/s 
Collecting signatory==1.2.4.1.7.1 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/58/93/cea761d492f908133d513fb1f93eb57bd0839b8ecd9eda0e97848a1c3c8f/signatory-1.2.4.1.7.1.tar.gz (61kB)
    100% |████████████████████████████████| 61kB 32.0MB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "/tmp/pip-install-fcnz7oau/signatory/setup.py", line 21, in <module>
        import torch.utils.cpp_extension as cpp
    ModuleNotFoundError: No module named 'torch'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-fcnz7oau/signatory/setup.py", line 23, in <module>
        raise ImportError("PyTorch is not installed, and must be installed prior to installing Signatory.")
    ImportError: PyTorch is not installed, and must be installed prior to installing Signatory.
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-fcnz7oau/signatory/

Is there any way to install torch and signatory simultaneously? This is work-related, and deployments are automated, so it would be kind of hard to make an exception for the service I'm developing so that it runs two different pip installs

I'm using Python 3.6.13 with pip==18.1 (although I tried it with pip==21.0.1 and get the same error). I'm using Ubuntu, the result of lsb_release -a is:

Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal

Thank you very much in advance.

Installation error of signatory==1.2.6.1.7.1 on GCP

Hey, I am currently trying to run a ML piece on GCP in the latest conda environment (conda 23.3.1). Below is the output of my conda list when I am trying to install signatory:
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
_pytorch_select 0.1 cpu_0
blas 1.0 mkl
ca-certificates 2023.01.10 h06a4308_0
certifi 2022.12.7 py38h06a4308_0
cffi 1.15.1 py38h74dc2b5_0
flit-core 3.8.0 py38h06a4308_0
intel-openmp 2019.4 243
ld_impl_linux-64 2.38 h1181459_1
libffi 3.3 he6710b0_2
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libmklml 2019.0.5 h06a4308_0
libstdcxx-ng 11.2.0 h1234567_1
mkl 2020.2 256
mkl-service 2.3.0 py38he904b0f_0
mkl_fft 1.3.0 py38h54f3939_0
mkl_random 1.1.1 py38h0573a6f_0
ncurses 6.4 h6a678d5_0
ninja 1.10.2 h06a4308_5
ninja-base 1.10.2 hd09550d_5
numpy 1.19.2 py38h54aff64_0
numpy-base 1.19.2 py38hfa32c7d_0
openssl 1.1.1t h7f8727e_0
pip 23.0.1 py38h06a4308_0
pycparser 2.21 pyhd3eb1b0_0
python 3.8.3 hcff3b4d_2
pytorch 1.7.1 cpu_py38h6a09485_0
readline 8.2 h5eee18b_0
setuptools 65.6.3 py38h06a4308_0
six 1.16.0 pyhd3eb1b0_1
sqlite 3.41.2 h5eee18b_0
tk 8.6.12 h1ccaba5_0
typing-extensions 4.4.0 py38h06a4308_0
typing_extensions 4.4.0 py38h06a4308_0
wheel 0.38.4 py38h06a4308_0
xz 5.2.10 h5eee18b_1
zlib 1.2.13 h5eee18b_0

But installation command "pip install signatory==1.2.6.1.7.1 --no-cache-dir --force-reinstall" gives me this error:
Collecting signatory==1.2.6.1.7.1
Downloading signatory-1.2.6.1.7.1.tar.gz (62 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 4.4 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Building wheels for collected packages: signatory
Building wheel for signatory (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [67 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/path.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/init.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/signature_module.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/unstable.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/augment.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/deprecated.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/utility.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/logsignature_module.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/signature_inversion_module.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/impl.py -> build/lib.linux-x86_64-cpython-38/signatory
running build_ext
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/tmp/pip-install-ob03iova/signatory_d1c497b804c54b7f800995e505ded1cb/setup.py", line 53, in
setuptools.setup(name=metadata.project,
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/init.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 325, in run
self.run_command("build")
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 132, in run
self.run_command(cmd_name)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
self.build_extensions()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 361, in build_extensions
self._check_abi()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 699, in _check_abi
check_compiler_abi_compatibility(compiler)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 265, in check_compiler_abi_compatibility
if not check_compiler_ok_for_platform(compiler):
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 225, in check_compiler_ok_for_platform
which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['which', 'g++']' returned non-zero exit status 1.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for signatory
Running setup.py clean for signatory
Failed to build signatory
Installing collected packages: signatory
Running setup.py install for signatory ... error
error: subprocess-exited-with-error

× Running setup.py install for signatory did not run successfully.
│ exit code: 1
╰─> [71 lines of output]
running install
/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-38
creating build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/path.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/init.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/signature_module.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/unstable.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/augment.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/deprecated.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/utility.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/logsignature_module.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/signature_inversion_module.py -> build/lib.linux-x86_64-cpython-38/signatory
copying src/signatory/impl.py -> build/lib.linux-x86_64-cpython-38/signatory
running build_ext
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/tmp/pip-install-ob03iova/signatory_d1c497b804c54b7f800995e505ded1cb/setup.py", line 53, in
setuptools.setup(name=metadata.project,
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/init.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/command/install.py", line 68, in run
return orig.install.run(self)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/command/install.py", line 698, in run
self.run_command('build')
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 132, in run
self.run_command(cmd_name)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
super().run_command(command)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
cmd_obj.run()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
_build_ext.run(self)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
self.build_extensions()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 361, in build_extensions
self._check_abi()
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 699, in _check_abi
check_compiler_abi_compatibility(compiler)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 265, in check_compiler_abi_compatibility
if not check_compiler_ok_for_platform(compiler):
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 225, in check_compiler_ok_for_platform
which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/home/yg2911/anaconda3/envs/py383/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['which', 'g++']' returned non-zero exit status 1.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> signatory

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I have tried on my own device and it exhibits the same behavior. Any solutions? Thanks so much!

Installation failed on Mac M1 Pro chip

The installation keeps failing. I suspect that it may be caused by Mac M series chip is not supported through PyTorch version 1.9.0. It might help to build this package through conda-forge?

ERROR: Undefined symbol building with torch 1.8.0

The execution of python setup.py install finishes without problems, but when I type the import signatory I get the following error:

/home/~/.pyenv/versions/3.8.2/lib/python3.8/site-packages/signatory/_impl.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe28TypeMeta21_typeMetaDataInstanceIN3c107complexIfEEEEPKNS_6detail12TypeMetaDataEv

I've been researching and it seems that version 1.8.0 has stopped supporting coffe.

Thanks for your excellent work

import signatory error

Hi, Patrick

Thanks for your work and I had an excellent experience using the signatory package to apply Signature transform for sequential data analysis. However, after I upgrade everything, it doesn't work now.
Python version: 3.9.7
signatory: 1.2.6.1.9.0
pytorch: 1.10.1
It cannot be downgraded to pytorch1.9.0. So I wonder if you can help me with this issue. Thanks a lot.
By the way, I upgraded Windows 10 system to Windows 11, not sure if this affects the packages.
pic

Install signatory on M2 Mac

I ran
python -m pip install signatory==1.2.6.1.9.0 --no-cache-dir --force-reinstall
and this is the error message:

`python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [24 lines of output]
running bdist_wheel
/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/utils/cpp_extension.py:370: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
warnings.warn(msg.format('we could not find ninja.'))
running build
running build_py
creating build
creating build/lib.macosx-11.0-arm64-cpython-38
creating build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/signature_inversion_module.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/logsignature_module.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/signature_module.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/unstable.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/utility.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/deprecated.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/init.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/augment.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/impl.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/path.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
running build_ext
building '_impl' extension
creating build/temp.macosx-11.0-arm64-cpython-38
creating build/temp.macosx-11.0-arm64-cpython-38/src
/usr/local/opt/llvm/bin/clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c src/logsignature.cpp -o build/temp.macosx-11.0-arm64-cpython-38/src/logsignature.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_clang" -DPYBIND11_STDLIB="_libcpp" -DPYBIND11_BUILD_ABI="_cxxabi1002" -DTORCH_EXTENSION_NAME=_impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
error: command '/usr/local/opt/llvm/bin/clang' failed: No such file or directory
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for signatory
Running setup.py clean for signatory
Failed to build signatory
ERROR: Could not build wheels for signatory, which is required to install pyproject.toml-based projects
(sigwgan) lerong@Rong ~ % brew install ninja
==> Downloading https://formulae.brew.sh/api/formula.jws.json
####################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
####################################################################################### 100.0%
==> Fetching ninja
==> Downloading https://ghcr.io/v2/homebrew/core/ninja/manifests/1.11.1
####################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ninja/blobs/sha256:6202ee2d9cdb003e70bd93acca
####################################################################################### 100.0%
==> Pouring ninja--1.11.1.arm64_ventura.bottle.tar.gz
==> Caveats
zsh completions have been installed to:
/opt/homebrew/share/zsh/site-functions

Emacs Lisp files have been installed to:
/opt/homebrew/share/emacs/site-lisp/ninja
==> Summary
🍺 /opt/homebrew/Cellar/ninja/1.11.1: 10 files, 435.3KB
==> Running brew cleanup ninja...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew).
(sigwgan) lerong@Rong ~ % python -m pip install signatory==1.2.6.1.9.0 --no-cache-dir --force-reinstall
Collecting signatory==1.2.6.1.9.0
Downloading signatory-1.2.6.1.9.0.tar.gz (62 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 755.9 kB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Building wheels for collected packages: signatory
Building wheel for signatory (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [111 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-11.0-arm64-cpython-38
creating build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/signature_inversion_module.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/logsignature_module.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/signature_module.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/unstable.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/utility.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/deprecated.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/init.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/augment.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/impl.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
copying src/signatory/path.py -> build/lib.macosx-11.0-arm64-cpython-38/signatory
running build_ext
building 'impl' extension
creating /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38
creating /private/var/folders/l_/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src
Emitting ninja build file /private/var/folders/l_/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/6] c++ -MMD -MF /private/var/folders/l_/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/signature.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l_/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/signature.cpp -o /private/var/folders/l_/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/signature.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="clang"' '-DPYBIND11_STDLIB="libcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1002"' -DTORCH_EXTENSION_NAME=impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
FAILED: /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/signature.o
c++ -MMD -MF /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/signature.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/signature.cpp -o /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/signature.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="libcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1002"' -DTORCH_EXTENSION_NAME=impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
clang: error: unsupported option '-fopenmp'
[2/6] c++ -MMD -MF /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/misc.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/misc.cpp -o /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/misc.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="clang"' '-DPYBIND11_STDLIB="libcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1002"' -DTORCH_EXTENSION_NAME=impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
FAILED: /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/misc.o
c++ -MMD -MF /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/misc.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/misc.cpp -o /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/misc.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="libcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1002"' -DTORCH_EXTENSION_NAME=impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
clang: error: unsupported option '-fopenmp'
[3/6] c++ -MMD -MF /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/pytorchbind.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/pytorchbind.cpp -o /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/pytorchbind.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="clang"' '-DPYBIND11_STDLIB="libcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1002"' -DTORCH_EXTENSION_NAME=impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
FAILED: /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/pytorchbind.o
c++ -MMD -MF /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/pytorchbind.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/pytorchbind.cpp -o /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/pytorchbind.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="libcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1002"' -DTORCH_EXTENSION_NAME=impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
clang: error: unsupported option '-fopenmp'
[4/6] c++ -MMD -MF /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/logsignature.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/logsignature.cpp -o /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/logsignature.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="clang"' '-DPYBIND11_STDLIB="libcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1002"' -DTORCH_EXTENSION_NAME=impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
FAILED: /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/logsignature.o
c++ -MMD -MF /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/logsignature.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/logsignature.cpp -o /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/logsignature.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="libcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1002"' -DTORCH_EXTENSION_NAME=impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
clang: error: unsupported option '-fopenmp'
[5/6] c++ -MMD -MF /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/tensor_algebra_ops.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/tensor_algebra_ops.cpp -o /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/tensor_algebra_ops.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="clang"' '-DPYBIND11_STDLIB="libcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1002"' -DTORCH_EXTENSION_NAME=impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
FAILED: /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/tensor_algebra_ops.o
c++ -MMD -MF /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/tensor_algebra_ops.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/tensor_algebra_ops.cpp -o /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/tensor_algebra_ops.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="libcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1002"' -DTORCH_EXTENSION_NAME=impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
clang: error: unsupported option '-fopenmp'
[6/6] c++ -MMD -MF /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/lyndon.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/lyndon.cpp -o /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/lyndon.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="clang"' '-DPYBIND11_STDLIB="libcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1002"' -DTORCH_EXTENSION_NAME=impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
FAILED: /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/lyndon.o
c++ -MMD -MF /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/lyndon.o.d -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/Users/lerong/miniconda3/envs/sigwgan/include -arch arm64 -I/usr/local/opt/llvm/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/TH -I/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/include/THC -I/Users/lerong/miniconda3/envs/sigwgan/include/python3.8 -c -c /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/src/lyndon.cpp -o /private/var/folders/l
/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/build/temp.macosx-11.0-arm64-cpython-38/src/lyndon.o -fvisibility=hidden -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_clang"' '-DPYBIND11_STDLIB="_libcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1002"' -DTORCH_EXTENSION_NAME=_impl -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
clang: error: unsupported option '-fopenmp'
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1666, in _run_ninja_build
subprocess.run(
File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/private/var/folders/l_/hv8jcrtx21gbrkh5jzb7xfz80000gn/T/pip-install-08eehflq/signatory_3d4fe674eff148669561bdf647a7d9ec/setup.py", line 53, in <module>
      setuptools.setup(name=metadata.project,
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/__init__.py", line 107, in setup
      return distutils.core.setup(**attrs)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/dist.py", line 1244, in run_command
      super().run_command(command)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 325, in run
      self.run_command("build")
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/dist.py", line 1244, in run_command
      super().run_command(command)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 131, in run
      self.run_command(cmd_name)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/dist.py", line 1244, in run_command
      super().run_command(command)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
      _build_ext.run(self)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
      self.build_extensions()
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 709, in build_extensions
      build_ext.build_extensions(self)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
      self._build_extensions_serial()
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
      self.build_extension(ext)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
      _build_ext.build_extension(self, ext)
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
      objects = self.compiler.compile(
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 530, in unix_wrap_ninja_compile
      _write_ninja_file_and_compile_objects(
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1355, in _write_ninja_file_and_compile_objects
      _run_ninja_build(
    File "/Users/lerong/miniconda3/envs/sigwgan/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1682, in _run_ninja_build
      raise RuntimeError(message) from e
  RuntimeError: Error compiling objects for extension
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for signatory
Running setup.py clean for signatory
Failed to build signatory
ERROR: Could not build wheels for signatory, which is required to install pyproject.toml-based projects`

I've installed gcc compiler, ninja, and pyproject-toml.

My python==3.8.10, torch==1.9.0, up-to-date llvm and libomp

How to fix the error? Thank you very much.

Why not use autograd directly?

Hi, Patrick,

Thanks a lot for your nice work and detailed code comments! I have a very naive question: why do not use pytorch autograd directly for backward process? Since I see the tensor operations are all like addcmul in forward process. I have some simple reasons but I am not sure if they are correct.

  1. custom backward process might have speed up comparing to autograd
  2. it can avoid intermediate variables and thus save memory

I am a newbie in custom pytorch functions. I would appreciate it if you could kindly share some opinions. Thank you again!

Error: unable to import signatory

Hi, after installing signatory with:

pip install signatory==1.2.1.1.4.0

I get an importing error:

$ python -c "import signatory"
Traceback (most recent call last):
  File "D:\Users\aperez\env\synthesizer\lib\site-packages\signatory\__init__.py", line 25, in <module>
    from . import impl
  File "D:\Users\aperez\env\synthesizer\lib\site-packages\signatory\impl.py", line 19, in <module>
    from . import _impl
ImportError: DLL load failed while importing _impl: The specified procedure could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "D:\Users\aperez\env\synthesizer\lib\site-packages\signatory\__init__.py", line 28, in <module>
    raise ImportError('Caught ImportError:\n```\n{}\n```\nThis can probably be fixed by updating your version of '
ImportError: Caught ImportError:

DLL load failed while importing _impl: The specified procedure could not be found.

This can probably be fixed by updating your version of Python, e.g. from 3.6.6 to 3.6.9. See the FAQ in the documentation.

I checked the FAQ page and it says that the problem is caused by having an older Python version, but my version is 3.8.3, which is relatively new:

$ python --version
Python 3.8.3

so I think the root of the problem may be another. I haven't seen any issue in this repo addressing this problem in Windows.


Environment details

$ pip freeze
Bottleneck==1.3.2
certifi==2020.12.5
cycler==0.10.0
joblib==1.0.1
kiwisolver==1.3.1
llvmlite==0.36.0
matplotlib==3.4.0
mkl-fft==1.3.0
mkl-random==1.1.1
mkl-service==2.3.0
numba==0.53.1
numexpr==2.7.3
numpy @ file:///C:/ci/numpy_and_numpy_base_1603466732592/work
olefile==0.46
pandas==1.2.3
Pillow @ file:///C:/ci/pillow_1615224342392/work
pyparsing==2.4.7
python-dateutil==2.8.1
pytz==2021.1
scikit-learn==0.24.1
scipy==1.6.2
signatory==1.2.1.1.4.0
six @ file:///C:/ci/six_1605187374963/work
threadpoolctl==2.1.0
torch==1.8.1
torchaudio==0.8.1
torchvision==0.9.1
tqdm==4.59.0
typing-extensions @ file:///home/ktietz/src/ci_mi/typing_extensions_1612808209620/work
wincertstore==0.2

MRE

$ python -c "import signatory"

System and machine info

Some data were removed

OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19042 N/A Build 19042
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Member Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          Skull
Registered Organization:   N/A
Original Install Date:     22/03/2021, 15:41:19
System Boot Time:          22/03/2021, 16:16:49
System Manufacturer:       System manufacturer
System Model:              System Product Name
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 26 Stepping 5 GenuineIntel ~3201 Mhz
BIOS Version:              American Megatrends Inc. 0803   , 06/08/2012
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume2
System Locale:             en-gb;English (United Kingdom)
Input Locale:              en-gb;English (United Kingdom)
Time Zone:                 (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
Total Physical Memory:     16.375 MB
Available Physical Memory: 10.339 MB
Virtual Memory: Max Size:  18.807 MB
Virtual Memory: Available: 10.660 MB
Virtual Memory: In Use:    8.147 MB
Page File Location(s):     C:\pagefile.sys

I've also tried remaking the environment and installing everything again, but the error persists.

Thanks in advance.

fail to install signatory

When I try to install signatory on linux as pip install -U signatory-1.2.3.1.4.0 --no-cache-dir --force-reinstall, It builds wheel faild, and the error list is so long. When I try to clone and install from source, it also failed. Here is the version of its dependencies:
gcc 9.2.0
python: 3.6.7
torch: 1.4.0
What can I do to fix this?

ImportError: dlopen(...): symbol not found in flat namespace '___kmpc_barrier'

Hi Patrick:

I got the error message:
ImportError: dlopen(/Users/Me/miniconda3/envs/sigwgan/lib/python3.8/site-packages/signatory/_impl.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '___kmpc_barrier'

My environment:

% pip freeze                                                   
attrs==23.1.0
boltons==23.0.0
certifi==2023.7.22
chardet==5.1.0
charset-normalizer==3.2.0
cmake==3.27.0
contourpy==1.1.0
cycler==0.11.0
fbm==0.3.0
fonttools==4.41.1
future==0.18.2
idna==3.4
importlib-resources==6.0.0
joblib==1.3.1
jsonschema==4.18.4
jsonschema-specifications==2023.7.1
kiwisolver==1.4.4
matplotlib==3.7.2
numpy==1.24.4
packaging==23.1
pandas==2.0.3
Pillow==10.0.0
pkgutil_resolve_name==1.3.10
py-lets-be-rational==1.0.1
py-vollib==1.0.1
pyparsing==3.0.9
pyproject-toml==0.0.10
python-dateutil==2.8.2
pytz==2023.3
referencing==0.30.0
requests==2.31.0
rpds-py==0.9.2
scikit-learn==1.3.0
scipy==1.10.1
signatory==1.2.6.1.9.0
simplejson==3.17.2
six==1.16.0
threadpoolctl==3.2.0
toml==0.10.2
torch==1.9.0
torchaudio==0.9.0
torchdiffeq==0.2.3
torchsde==0.2.5
torchvision==0.10.0
tqdm==4.49.0
trampoline==0.1.2
typing_extensions==4.7.1
tzdata==2023.3
urllib3==2.0.4
wfdb==3.2.0
zipp==3.16.2

  • My chip: Apple M2
  • My macOS: macOS Ventura 13.4.1
  • Python 3.8.10 universal2 (for macOS 11 Big Sur and later; recommended on Apple Silicon), build hab31e5c_2_cpython, channel conda-forge

Unfortunately, torch 1.7.0 does not support arm64, so I cannot use this version or even older. How can I fix it?

Error Installing Signatory 1.2.5

Hi, I installed signatory 1.2.4 with pytorch 1.7.1 which worked like a charm.
However, when trying to install version 1.2.5 (since I am really interested to try out the inversion function) I get the following error message:

pip install signatory==1.2.5.1.7.1 --no-cache-dir --force-reinstall
Note: you may need to restart the kernel to use updated packages.
ERROR: Could not find a version that satisfies the requirement signatory==1.2.5.1.7.1
ERROR: No matching distribution found for signatory==1.2.5.1.7.1

I also tried to install signatory 1.2.5 together with pytorch 1.8.0 or 1.8.1 which yielded the same error message. In fact I get this error also when trying to install version 1.2.4 together with other pytorch versions.
Am I missing something here?

Thanks

Signatory slower than iisignature

Dear Patrick,

first, thank you for this great package and its documentation! I am following up on the comment in the documentation's FAQs, that Signatory should be faster than iisignature even on CPU. https://signatory.readthedocs.io/en/latest/pages/miscellaneous/faq.html

I wrote a simple script to compare the time needed for calculating the signature of a path of both packages. Turns out, for shorter paths (up to length of 10^3 or 10^4), a smaller signature truncation depth (up to level 3 or 4), as well as small number of input channels (up to 6 or 7) the iisignature package is substantially faster. Depending on the values of above three parameters between 1.5 and 12 times faster, whereas the speed up decreases the larger the parameter values.

This stands partly in contrast to the claim in the package's documentation. Do you have an explanation why signatory is slower? Is there a way to speed up calculations for shorter paths?

Specifically: The function 'signature' provides the functionality of updating the signature of a path with new information using Chen's idendity, which should be faster than computing the whole signature again. Does this functionality work with automatic gradient calculations?

I ran the script on CPU on a 2,6 GHz Quad-Core Intel Core i7 MacBook Pro from 2016 with the following versions:

  • Python: 3.8
  • signatory: 1.2.3 (in combination with torch 1.6.0)
  • iisignature: 0.24

Some background: I am currently using signatory in a reinforcement learning project, utilizing its implementation of the signature calculation as PyTorch nn.Module for automatic gradient calculations, however training my algorithm takes a very long time, since the signature is calculsted at every step the RL algorithm takes. I have been working with the iisignature package before, but switched to your signatory package to be able to fully use automatic differentiation (I am still new to PyTorch, so the signatory implementation was great help). The paper "Deep Signature Transform" was part of the inspiration for my project. Trying to reproduce some results of the paper, I realized how much faster computations where, which led me to this simple experiment.

I include my script for time comparison below.
Thank you and best, Felix

import torch
import signatory
import iisignature
import time
import numpy as np

runs = 10
max_length = 6
channels = 7
sig_depth = 3
times_iisig = np.zeros(max_length)
times_signatory = np.zeros(max_length)

for j in range(runs):
    for i in range(max_length):
        path = torch.rand(10**(i+1), channels)

        start = time.time()
        sig = iisignature.sig(path, sig_depth)
        end = time.time()
        times_iisig[i] += (end - start)    
        del(sig)

        path = path.unsqueeze(0)
        start = time.time()
        sig = signatory.signature(path, sig_depth)
        end = time.time()
        times_signatory[i] += (end - start)
        del(path, sig)

print('Times iisignsture: \n', times_iisig / runs)
print('Times signatory: \n ', times_signatory / runs)
print('Speed up: \n', times_signatory / times_iisig)
print('Average speed up:', (times_signatory / times_iisig).mean())

Is it possible to expose the exp map to the Python API via a logsignature_to_signature function?

Somehow, I found myself needing to map a logsignature back to the full signature (where the logsignature can be in either the tensor algebra or a compressed form). It appears the relevant operations such as exp map already exist in the C++ code, so I wonder how difficult it would be to implement a logsignature_to_signature function.

Currently, I have tried two options. The iisignature package do offer a mapping from logsignature to signature, but this requires casting data from PyTorch to numpy and back, and potentially also moving data between devices, so it works, but is not ideal.

Alternatively, I could implement the truncated expansion of the exp map directly in PyTorch, following the template in iisignature and also bottler's free-lie-algebra-py, using the exp(x)=1+x+x/2(x+x/3(x+...)) trick. However, this is significantly slower than computing via iisignature.

Therefore I guess my best bet is to expose the exp map within signatory's C++ code to the Python API. However, I am not familiar with PyTorch in C++ and am not sure how much effort it would take to try to implement a logsignature_to_signature function.

Is it possible that such a functionality can be implemented fairly quickly? And is it possible for logsignature_to_signature to eventually be included in signatory?

Many thanks!

Confusion about comment of the "include_original" in Augment

Hi, Patrick.
Thanks for your code and Document. They really help me a lot. However, I found a little "mistake" in the interpolation about the parameter "include_original" in class Augment. It says that when "include_original" is set to be True, then for each $\Phi(x_i,...,x_{k+i-1})$, original element of the sequence will be included as well. And the output is of the form $(,x_i,\phi(x_i,...,x_{k+i-1}))$. But when I dived into the source code of "Augment", I noticed that it actually be $(,x_{k+i-1},\phi(x_i,..x_{k+i-1}))$. I'm not sure whether this inconsistence is intentional or actually a mistake.

Project maintenance

Hi there,

This is a really valuable project, but I'm reluctant to use it at work because it doesn't look like it is being actively maintained (the docs reference support up to Python 3.9 and PyTorch 1.11, and I don't think that's changed for a while(?)). I'm certainly not being critical because I know you're working on lots of other great open-source projects for the ML community, but it would help to understand the author's plans to maintain this project going forward before I decide whether to make heavier use of it.

Thanks again for all the valuable work you've put into this package so far!

Being able to compute signatures using signatory.Path for a subset of the batch dimension.

Hello,

I'd like to be able to compute signatures through the path object but only for a subset of my batch dimension at a time. At the moment, Path seems to only allow signatures to be returned on the full data before I can subset with the batch dimension. See the example below

path_cls = signatory.Path(data)

# Current way
signatures = path_cls.signature(i, j)
batch_signatures = signatures[batch_idxs]

# Ideal
signatures = path_cls.signature([batch_idxs, [i, j]])

Would it be possible to implement a behaviour like the bottom line?

Thanks!

How to invert log-signatures ?

Hi @patrick-kidger

Disclosure: I am quite new to signature transforms (and haven't finished whole theory yet) but found it's properties useful, so trying to play with it.

I don't see the API to invert the log-signatures ? Can it be inverted ? If so, how ?

Error running from python3.9.9 on a guix system

Can you advise me on these errors? Thank you

I believe I can run on a docker image on my other computer, which is an arch install where tensorflow/rocm can run.

import numpy as np
import torch as pt
import pandas as pdA

import signatory as sg
path = torch.rand(2,10,3)

I'm not sure whether I can run the same setup on this laptop. It's also an AMD machine, but with integrated graphics and proprietery drivers.

However, this error involves a glibc mismatch:

libstdc++.so.6: version GLIBCXX_3.4.29' not found`

I could run patchelf on some of the compiled artifacts downloaded/built via pip (these are not in the guix /gnu/store but are in the .venv folder). However, I can't easily run it on the guix python3.9.9 package, since it's an immutable install.

Here's the results of ldd /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libstdc++.so.6

        linux-vdso.so.1 (0x00007ffec66f4000)
        libm.so.6 => /home/dc/.guix-extra-profiles/devtools/devtools/lib/libm.so.6 (0x00007ff0d7f53000)
        libc.so.6 => /home/dc/.guix-extra-profiles/devtools/devtools/lib/libc.so.6 (0x00007ff0d7d91000)
        /gnu/store/ayc9r7162rphy4zjw8ch01pmyh214h82-glibc-2.33/lib/ld-linux-x86-64.so.2 (0x00007ff0d826b000)
        libgcc_s.so.1 => /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgcc_s.so.1 (0x00007ff0d7d77000)

And the error (with readelf on libstdc++ here: https://0x0.st/HKSv.txt)

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[2], line 1
----> 1 import signatory as sg
      2 path = torch.rand(2,10,3)

File ~/src/pytest/.direnv/python-3.9.9/lib/python3.9/site-packages/signatory/__init__.py:25
     22 import torch  # must be imported before anything from signatory
     24 try:
---> 25     from . import impl
     26 except ImportError as e:
     27     if 'specified procedure could not be found' in str(e):

File ~/src/pytest/.direnv/python-3.9.9/lib/python3.9/site-packages/signatory/impl.py:19
     15 """Provides an interface to _impl."""
     18 # noinspection PyUnresolvedReferences
---> 19 from . import _impl
     22 # For some reason some exceptions on a Mac are converted to RuntimeErrors rather than ValueErrors.
     23 # So we have to make a conversion.
     24 # This isn't perfect; any genuine RuntimeErrors will now always be ValueErrors.
     25 # So for consistency across platforms we _always_ convert RuntimeErrors to ValueErrors.
     26 def _wrap(fn):
     27     # We'd like to perform a check that fn is actually a function here
     28     # But that throws an error with the mocking used in the documentation
   (...)
     32     # but again it fails with autodoc.
     33     # Not super important, as nothing in this module should be public anyway.

ImportError: /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/dc/src/pytest/.direnv/python-3.9.9/lib/python3.9/site-packages/signatory/_impl.cpython-39-x86_64-linux-gnu.so)

Installation on M1 Macbook

Thanks for the great codebase! I was trying to install it on my M1 Macbook Air using the command pip install signatory==1.2.6.1.8.0 --no-cache-dir --force-reinstall (I already have pytorch 1.8.0 installed), but I get a giant error message. Some of the more prominent warnings include the compiler warning below (screenshot attached), an error clang: error: unsupported option '-fopenmp', and RuntimeError: Error compiling objects for extension. I'd be happy to provide the full error trace if it would be helpful. Any pointers would be appreciated - thank you!

Screen Shot 2022-02-02 at 1 58 02 PM

How to generate the signature of each point in a sliding-window manner?

Hi,
I am very interested in the path signature. Your provided code is very helpful. However, when I run the signatory.signature(Path, depth), it only generates the signature of the whole path. If I want to generate the signature of each point in a sliding-window manner, how should I change the code?

Thank you in advance.

Exception messages on Mac aren't very helpful

As noted in the FAQ, the exception messages aren't very helpful on Mac.

Every exception thrown from the C++ isn't correctly interpreted by pybind11, and becomes a RuntimeError: caught an unknown exception. (When all we ever actually throw are ValueErrors with descriptive messages.) At the moment this is worked around on the Python side by converting the RuntimeErrors to ValueErrors, but there's no way to recover the informative error message.

It's not clear if this is a Mac issue or if it's really a clang issue.

Anyway, it would be good to find a work-around.

No signatory 1.2.7 on PyPI

Hello, I need to use Pytorch 1.10.1, which is only compatible with signatory==1.2.7, however PyPI does not have a 1.2.7 release. Could you please create a new one there?

Thank you for creating such an unique niche mathematics package for us.

pip install signatory==1.2.7.1.10.1 --no-cache-dir --force-reinstall
ERROR: No matching distribution found for signatory==1.2.7.1.10.1

image

PyTorch 1.5 + CUDA + backward doesn't work

import torch
import signatory
x = torch.rand(1, 8, 2, requires_grad=True, device='cuda')
u = signatory.signature(x, 2)
u.sum().backward()

Probably because of the backward-incompatible memory format change they introduced.

macOS 13.4.1 python setup.py install

Hi Patrick:

I tried another way of installation:

git clone https://github.com/patrick-kidger/signatory.git
cd signatory
python setup.py install

And then enter the command:
MACOSX_DEPLOYMENT_TARGET=13.4.1 CC=clang CXX=clang++ python setup.py install

I'm curious that what's the problem that causes the error.
My setting:

  • python 3.8.10 universal2
  • torch 1.9.0 torchaudio 0.9.0 torchvision 0.10.0
  • macOS 13.4.1
  • apple M2

Thank you very much.

Error importing signatory on Colab (undefined symbol error)

Hi Patrick,

I'm hoping to use Signatory for a Colab script, but I'm not able to import the package after successfully installing it. The below error message shows up when I try to import:

image

I first installed Torch and then installed Signatory that's compatible with the version of Torch, and the installation is as below:

image

I'm not sure whether this would be related - I also installed the RAPIDS package and seems like it would install a version of Torch during the process. I see two different versions of Torch when I check version using .__version and pip show, as below:

image

I'm only able to uninstall the version 1.9.0 (which I installed separately) using pip uninstall, but I can't uninstall the one that's installed during the RAPIDS installation (1.13.1+cu116).

If you have any suggestions on how I can successfully import Signatory on Colab, I'd really appreciate it. Thanks!

ERROR: No matching distribution found for signatory==1.2.7.1.11.0

Hello,
I am trying to install the latest version of signatory (1.2.7) with pytorch 1.10.0 on windows.
When I run the command from the readme
pip install signatory==1.2.7.1.11.0 --no-cache-dir --force-reinstall
I get the error
ERROR: Could not find a version that satisfies the requirement signatory==1.2.7.1.11.0 (from versions: 0.1.0, 0.1.1, 0.1.2, 0.2.0, 1.0.0, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4.1.2.0, 1.1.4.1.3.0, 1.1.5.1.2.0, 1.1.5.1.3.0, 1.1.6.1.2.0, 1.1.6.1.3.0, 1.1.6.1.3.1, 1.2.0.1.2.0, 1.2.0.1.3.0, 1.2.0.1.3.1, 1.2.0.1.4.0, 1.2.1.1.2.0, 1.2.1.1.3.0, 1.2.1.1.3.1, 1.2.1.1.4.0, 1.2.1.1.5.0, 1.2.2.1.2.0, 1.2.2.1.3.0, 1.2.2.1.3.1, 1.2.2.1.4.0, 1.2.2.1.5.0, 1.2.2.1.5.1, 1.2.3.1.2.0, 1.2.3.1.3.0, 1.2.3.1.3.1, 1.2.3.1.4.0, 1.2.3.1.5.0, 1.2.3.1.5.1, 1.2.3.1.6.0, 1.2.4.1.6.0, 1.2.4.1.7.0, 1.2.4.1.7.1, 1.2.6.1.6.0, 1.2.6.1.7.0, 1.2.6.1.7.1, 1.2.6.1.8.0, 1.2.6.1.8.1, 1.2.6.1.9.0) ERROR: No matching distribution found for signatory==1.2.7.1.11.0
I am on windows using python 3.7.4. This seems strange to me seeing as this is exactly the command specified in the documentation. Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.