Sig functions#

signature_cuda#

int signature_cuda_f(const float *path, float *out, uint64_t batch_size, uint64_t dimension, uint64_t length, uint64_t degree, bool time_aug = false, bool lead_lag = false, float end_time = 1.f, bool horner = true, bool scalar_term = true) noexcept#

Computes the truncated signatures of a batch of paths on the GPU.

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

  • out – Pointer to output buffer (row-major, preallocated, on device), size = batch_size * sig_length(transformed_dimension, degree), where transformed_dimension = (lead_lag ? 2 : 1) * dimension + (time_aug ? 1 : 0).

  • batch_size – Batch size.

  • dimension – Dimension of the paths.

  • length – Length of the paths.

  • degree – Truncation degree of the signature.

  • 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).

  • horner – Whether to use the Horner algorithm (default = true).

Returns:

Status code (0 = success).

int signature_cuda_d(const double *path, double *out, uint64_t batch_size, uint64_t dimension, uint64_t length, uint64_t degree, bool time_aug = false, bool lead_lag = false, double end_time = 1., bool horner = true, bool scalar_term = true) noexcept#

sig_backprop_cuda#

int sig_backprop_cuda_f(const float *path, float *out, const float *sig_derivs, const float *sig, uint64_t batch_size, uint64_t dimension, uint64_t length, uint64_t degree, bool time_aug = false, bool lead_lag = false, float end_time = 1.f, bool scalar_term = true) noexcept#

Backpropagates through the batch signature computation on the GPU (float).

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

  • out – Pointer to output buffer (row-major, preallocated, on device), same size as path.

  • sig_derivs – Pointer to dF/d(sig) (on device), size = batch_size * sig_length(transformed_dimension, degree).

  • sig – Pointer to forward signatures (on device), same size as sig_derivs.

  • batch_size – Batch size.

  • dimension – Dimension of the paths.

  • length – Length of the paths.

  • degree – Truncation degree of the signature.

  • 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 sig_backprop_cuda_d(const double *path, double *out, const double *sig_derivs, const double *sig, uint64_t batch_size, uint64_t dimension, uint64_t length, uint64_t degree, bool time_aug = false, bool lead_lag = false, double end_time = 1., bool scalar_term = true) noexcept#

linear_sig_cuda#

int linear_sig_cuda_f(const float *displacement, float *out, uint64_t batch_size, uint64_t dimension, uint64_t degree, bool scalar_term = true) noexcept#
int linear_sig_cuda_d(const double *displacement, double *out, uint64_t batch_size, uint64_t dimension, uint64_t degree, bool scalar_term = true) noexcept#

sig_join_cuda#

int sig_join_cuda_f(const float *sig, const float *displacement, float *out, uint64_t batch_size, uint64_t dimension, uint64_t degree, bool prepend = false, bool scalar_term = true) noexcept#
int sig_join_cuda_d(const double *sig, const double *displacement, double *out, uint64_t batch_size, uint64_t dimension, uint64_t degree, bool prepend = false, bool scalar_term = true) noexcept#

sig_join_backprop_cuda#

int sig_join_backprop_cuda_f(const float *d_out, float *d_sig, float *d_displacement, const float *sig, const float *displacement, uint64_t batch_size, uint64_t dimension, uint64_t degree, bool prepend = false, bool scalar_term = true) noexcept#
int sig_join_backprop_cuda_d(const double *d_out, double *d_sig, double *d_displacement, const double *sig, const double *displacement, uint64_t batch_size, uint64_t dimension, uint64_t degree, bool prepend = false, bool scalar_term = true) 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}
}