pysiglib.prepare_log_sig

pysiglib.prepare_log_sig#

Added in version v1.0.0.

prepare_log_sig(dimension, degree, method, time_aug=False, lead_lag=False, use_disk=False)[source]#

Prepares for log signature computations. For details concerning the method parameter, see the page Computing Log Signatures. This function is not thread safe.

Parameters:
  • dimension (int) – Dimension of the underlying path(s).

  • degree (int) – Truncation degree of the log signature.

  • method (int) – Method for the log signature computation. Must be one of 0, 1 or 2.

  • time_aug (bool) – Whether time augmentation will be used in the computation.

  • lead_lag (bool) – Whether the lead lag transform will be used in the computation.

  • use_disk (bool) – If False, will cache prepared objects in memory only. If True, will also save these objects in a cache directory to be re-used for future runs. See additionally the documentation for pysiglib.set_cache_dir.

Example usage:#

import pysiglib

pysiglib.prepare_log_sig(5, 3, lead_lag=True, method=2, use_disk=True)

X = torch.rand((32,100,5))
X_log_sig = pysiglib.log_sig(X, 3, lead_lag=True, method=2)

Citation#

If you found this library useful in your research, please consider citing the paper:

@article{shmelev2025pysiglib,
  title={pySigLib-Fast Signature-Based Computations on CPU and GPU},
  author={Shmelev, Daniil and Salvi, Cristopher},
  journal={arXiv preprint arXiv:2509.10613},
  year={2025}
}