pysiglib.branched_sig_to_log_sig#
- branched_sig_to_log_sig(bsig, dimension, degree, *, time_aug=False, lead_lag=False, planar=False, n_jobs=1)[source]#
Computes the branched log signature from the branched signature.
- Parameters:
bsig (numpy.ndarray | torch.tensor) – The branched signature or batch of branched signatures, given as a numpy.ndarray or torch.tensor. For a single branched signature, this must be of shape
branched_sig_length. For a batch of paths, this must be of shape(batch_size, branched_sig_length). The leading scalar term may be present or omitted.dimension (int) – Dimension of the underlying path(s).
degree (int) – Truncation degree of the branched signature(s).
time_aug (bool) – Whether the branched signature(s) were computed with
time_aug=True.lead_lag (bool) – Whether the branched signature(s) were computed with
lead_lag=True.planar (bool) – If True, use planar branched signatures.
n_jobs (int) – Number of threads to run in parallel. If n_jobs = 1, the computation is run serially. If set to -1, all available threads are used. For n_jobs below -1, (max_threads + 1 + n_jobs) threads are used. For example if n_jobs = -2, all threads but one are used.
- Returns:
The branched log signature or batch of branched log signatures, in the same scalar-term format as
bsig.- Return type:
numpy.ndarray | torch.tensor
Example usage:#
import torch import pysiglib path = torch.rand((10, 100, 5)) bsig = pysiglib.branched_sig(path, 3) blogsig = pysiglib.branched_sig_to_log_sig(bsig, 5, 3) print(blogsig)
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}
}