Transform path functions#
transform_path#
-
int transform_path_f(const float *data_in, float *data_out, uint64_t batch_size, uint64_t dimension, uint64_t length, bool time_aug = false, bool lead_lag = false, float end_time = 1., int n_jobs = 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, wheretransformed_length = lead_lag ? length * 2 - 1 : lengthandtransformed_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).
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 transform_path_d(const double *data_in, double *data_out, uint64_t batch_size, uint64_t dimension, uint64_t length, bool time_aug = false, bool lead_lag = false, double end_time = 1., int n_jobs = 1) noexcept#
transform_path_backprop#
-
int transform_path_backprop_f(const float *derivs, float *data_out, uint64_t batch_size, uint64_t dimension, uint64_t length, bool time_aug = false, bool lead_lag = false, float end_time = 1., int n_jobs = 1) noexcept#
Backpropagation through the transform_path function.
- Parameters:
derivs – Pointer to derivatives with respect to transformed path (row-major), size =
batch_size * transformed_length * transformed_dimension, wheretransformed_length = lead_lag ? length * 2 - 1 : lengthandtransformed_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).
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 transform_path_backprop_d(const double *derivs, double *data_out, uint64_t batch_size, uint64_t dimension, uint64_t length, bool time_aug = false, bool lead_lag = false, double end_time = 1., 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}
}