pysiglib.logsig_to_sig_backprop

pysiglib.logsig_to_sig_backprop#

Added in version v3.0.0.

logsig_to_sig_backprop(log_sig, sig_derivs, dimension, degree, *, time_aug=False, lead_lag=False, method=1, scalar_term=False, n_jobs=1)[source]#

Backpropagation through pysiglib.logsig_to_sig().

Given upstream derivatives sig_derivs (dL/d(sig)), computes the gradient dL/d(log_sig).

Supports all methods (0, 1, 2).

Parameters:
  • log_sig (numpy.ndarray | torch.tensor) – The log-signature used in the forward pass.

  • sig_derivs (numpy.ndarray | torch.tensor) – Upstream derivatives dL/d(sig), same shape as the signature output.

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

  • degree (int) – Truncation degree.

  • time_aug (bool) – Whether the signatures were computed with time_aug=True.

  • lead_lag (bool) – Whether the signatures were computed with lead_lag=True.

  • method (int) – Method to use (0, 1, or 2). Must match the method used in the forward pass.

  • scalar_term (bool) – For methods 1 and 2, whether sig_derivs includes the leading constant 1 at index 0 and the returned gradient should too. Ignored for method 0: the format is inferred from the input log_sig (which is sig-shaped for method 0) and the returned gradient matches it.

  • n_jobs (int) – Number of threads to run in parallel.

Returns:

Gradient dL/d(log_sig), same shape as log_sig.

Return type:

numpy.ndarray | torch.tensor


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}
}