pysiglib.transform_path_backprop

pysiglib.transform_path_backprop#

Added in version v0.2.

transform_path_backprop(derivs, time_aug=False, lead_lag=False, end_time=1.0, n_jobs=1)[source]#

This function is required to backpropagate through pysiglib.transform_path. Given the derivatives of a scalar function \(F\) with respect to the result of pysiglib.transform_path, \(\{\partial F / \partial \tilde{x}_{t_i}\}_{i=0}^\tilde{L}\), returns the derivatives of \(F\) with respect to the original path, \(\{\partial F / x_{t_i}\}_{i=0}^L\).

Parameters:
  • derivs (numpy.ndarray | torch.tensor) – The derivatives with respect to the result of pysiglib.transform_path, \(\{\partial F / \partial \tilde{x}_{t_i}\}_{i=0}^\tilde{L}\).

  • time_aug (bool) – If True, assumes the derivatives are with respect to a time augmented path.

  • lead_lag (bool) – If True, assumes the derivatives are with respect to a lead-lag transformed path.

  • end_time (float) – End time for time-augmentation, \(t_L\).

  • 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:

Derivatives with respect to the original path, \(\{\partial F / x_{t_i}\}_{i=0}^L\).

Return type:

numpy.ndarray | torch.tensor

Note

Ideally, any array passed to pysiglib.transform_path_backprop should be both contiguous and own its data. If this is not the case, pysiglib.transform_path_backprop will internally create a contiguous copy, which may be inefficient.


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