Sig combine functions#
sig_combine#
-
int sig_combine_f(const float *sig1, const float *sig2, float *out, uint64_t batch_size, uint64_t dimension, uint64_t degree, bool scalar_term = true, int n_jobs = 1) noexcept#
Combines pairs of truncated signatures of the same degree and dimension.
- Parameters:
sig1 – Pointer to the batch of first truncated signatures (row-major), size =
batch_size * sig_length(dimension, degree).sig2 – Pointer to the batch of second truncated signatures (row-major), size =
batch_size * sig_length(dimension, degree). Must have the same batch size, degree and dimension as the first.out – Pointer to the output buffer (row-major, preallocated), size =
batch_size * sig_length(dimension, degree).batch_size – Batch size of sig1 and sig2.
dimension – Dimension of the underlying paths.
degree – Truncation degree of the signatures.
n_jobs – 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 (default = 1).
- Returns:
Status code (0 = success).
-
int sig_combine_d(const double *sig1, const double *sig2, double *out, uint64_t batch_size, uint64_t dimension, uint64_t degree, bool scalar_term = true, int n_jobs = 1) noexcept#
sig_combine_backprop#
-
int sig_combine_backprop_f(const float *sig_combined_derivs, float *sig1_deriv, float *sig2_deriv, const float *sig1, const float *sig2, uint64_t batch_size, uint64_t dimension, uint64_t degree, bool scalar_term = true, int n_jobs = 1) noexcept#
Backpropagation through the sig_combine function.
- Parameters:
sig_combined_derivs – Pointer to the derivatives with respect to the combined signatures (row-major), size =
batch_size * sig_length(dimension, degree).sig1_deriv – Pointer to the output buffer for the derivatives with respect to sig1 (row-major, preallocated), size =
batch_size * sig_length(dimension, degree).sig2_deriv – Pointer to the output buffer for the derivatives with respect to sig2 (row-major, preallocated), size =
batch_size * sig_length(dimension, degree).sig1 – Pointer to the batch of first truncated signatures (row-major, precomputed), size =
batch_size * sig_length(dimension, degree).sig2 – Pointer to the batch of second truncated signatures (row-major, precomputed), size =
batch_size * sig_length(dimension, degree). Must have the same batch size, degree and dimension as sig1.batch_size – Batch size of the signatures.
dimension – Dimension of the underlying paths.
degree – Truncation degree of the signatures.
n_jobs – 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 (default = 1).
- Returns:
Status code (0 = success).
-
int sig_combine_backprop_d(const double *sig_combined_derivs, double *sig1_deriv, double *sig2_deriv, const double *sig1, const double *sig2, uint64_t batch_size, uint64_t dimension, uint64_t degree, bool scalar_term = true, int n_jobs = 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}
}