Skip to main content

Sparse signature coefficient computations via kernels

Project description

sigcoeff

Sparse Signature Coefficient Recovery via Kernels

This package provides an example implementation for computing deep coefficients of the path signature transform using signature kernels on both CPU and GPU, to accompany the paper Sparse Signature Coefficient Recovery via Kernels. This method allows for parallelised computation of coefficients, with a time complexity independent of their depth.


Installation

pip install git+https://github.com/daniil-shmelev/sigcoeff.git

How to use the package

To run the below, see ./examples/example_usage.py

import torch
import sigcoeff

torch.manual_seed(42)

# Underlying path
len_x = 1000
dim = 10
X = torch.rand((len_x, dim), device="cpu")

# Target multi-index
multi_index = [1, 5, 2, 6, 3]

# Algorithm parameters
M = 2
dyadic_order = 3

#############################################
# Serial CPU computation
#############################################
coeff = sigcoeff.coeff(X, multi_index, scaling_depth=M, dyadic_order=dyadic_order, parallel=False)

#############################################
# Parallel CPU computation
#############################################
coeff = sigcoeff.coeff(X, multi_index, scaling_depth=M, dyadic_order=dyadic_order, parallel=True)

#############################################
# Parallel GPU computation
#############################################
coeff = sigcoeff.coeff(X.cuda(), multi_index, scaling_depth=M, dyadic_order=dyadic_order)

#############################################
# Varying dyadic orders for the two dimensions of the PDE grid
#############################################
coeff = sigcoeff.coeff(X.cuda(), multi_index, scaling_depth=M, dyadic_order=(3, 2))

#############################################
# Extraction of the entire grid of coefficients. I.e. all coefficients given by multi_index[:i],
# evaluated at all time points up to len_x. (CUDA only)
#############################################
coeff_grid = sigcoeff.coeff(X.cuda(), multi_index, scaling_depth=M, dyadic_order=dyadic_order, full=True)

Citation

@article{shmelev2024sparsesig,
  title={Sparse Signature Coefficient Recovery via Kernels},
  author={Shmelev, Daniil and Cristopher, Salvi},
  journal={arXiv preprint arXiv:2412.08579},
  year={2024}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sigcoeff-1.0.tar.gz (155.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sigcoeff-1.0-cp313-cp313-win_amd64.whl (87.6 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

Details for the file sigcoeff-1.0.tar.gz.

File metadata

  • Download URL: sigcoeff-1.0.tar.gz
  • Upload date:
  • Size: 155.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for sigcoeff-1.0.tar.gz
Algorithm Hash digest
SHA256 86c836c9e205a491979226a8a976a258e955ddf2c33958eb6477824c22529405
MD5 94a528dd482f49654c950396cd0478bb
BLAKE2b-256 29553c35e60c1cf2634bed25e36c1e112dcd9675ac33aa77d42e00cbb9253d55

See more details on using hashes here.

File details

Details for the file sigcoeff-1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: sigcoeff-1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 87.6 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for sigcoeff-1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 73f4ef7893f0c6af24329bb488ac749b3696657f9110bd1de00cc1006377a79f
MD5 88d77b3658e469831dc59cb6a730a355
BLAKE2b-256 059a424df8e49dfbf6d294b7a570cd35a05ae7d4451d1402dd0c7957c736d4f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page