Transform path functions#

transform_path_cuda#

int transform_path_cuda_f(const float *data_in, float *data_out, uint64_t batch_size, uint64_t dimension, uint64_t length, bool time_aug, bool lead_lag, float end_time = 1.) noexcept#

Applies time-augmentation and/or the lead-lag transformation to a batch of paths.

Parameters:
  • data_in – Pointer to input path data (row-major), size = batch_size * length * dimension.

  • data_out – Pointer to output buffer (row-major, preallocated), size = batch_size * transformed_length * transformed_dimension, where transformed_length = lead_lag ? length_ * 2 - 1 and transformed_dimension = (lead_lag ? 2 : 1) * dimension + (time_aug ? 1 : 0).

  • batch_size – Batch size of the paths.

  • dimension – Dimension of the paths.

  • length – Length of the paths.

  • time_aug – Whether to add time augmentation (default = false).

  • lead_lag – Whether to apply the lead-lag transform (default = false).

  • end_time – End time for time augmentation (default = 1.0).

Returns:

Status code (0 = success).

int transform_path_cuda_d(const double *data_in, double *data_out, uint64_t batch_size, uint64_t dimension, uint64_t length, bool time_aug, bool lead_lag, double end_time = 1.) noexcept#

transform_path_backprop_cuda#

int transform_path_backprop_cuda_f(const float *derivs, float *data_out, uint64_t batch_size, uint64_t dimension, uint64_t length, bool time_aug, bool lead_lag, float end_time = 1.) noexcept#

Backpropagation through the transform_path_cuda function.

Parameters:
  • derivs – Pointer to derivatives with respect to transformed path (row-major), size = batch_size * transformed_length * transformed_dimension, where transformed_length = lead_lag ? length_ * 2 - 1 and transformed_dimension = (lead_lag ? 2 : 1) * dimension + (time_aug ? 1 : 0).

  • data_out – Pointer to output buffer (row-major, preallocated), size = batch_size * length * dimension.

  • batch_size – Batch size of the paths.

  • dimension – Dimension of the original (pre-transformation) paths.

  • length – Length of the original (pre-transformation) paths.

  • time_aug – Whether time augmentation was applied (default = false).

  • lead_lag – Whether the lead-lag transform was applied (default = false).

  • end_time – End time for time augmentation (default = 1.0).

Returns:

Status code (0 = success).

int transform_path_backprop_cuda_d(const double *derivs, double *data_out, uint64_t batch_size, uint64_t dimension, uint64_t length, bool time_aug, bool lead_lag, double end_time = 1.) noexcept#

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