pysiglib.LogSigWindowStream

pysiglib.LogSigWindowStream#

Added in version v3.0.0.

class LogSigWindowStream(dimension, degree, window_size, *, stride=1, method=2, n_jobs=1, _log_sig=None)[source]#

A fixed-width sliding window over a stream of incoming points that emits windowed log-signatures. A new window is emitted every stride points once enough points have been accumulated to fill the window.

Accepts a single path or a batch of independent paths - the batch shape is inferred from the first push / push_batch call.

Note

You must call pysiglib.prepare_log_sig(dimension, degree, method=2) before creating a LogSigWindowStream.

Parameters:
  • dimension (int) – Dimension of the underlying space, \(d\).

  • degree (int) – Truncation level of the log-signature, \(N\).

  • window_size (int) – Number of points per window.

  • stride (int) – Number of points between successive window starts. Default 1.

  • method (int) – Method used for per-window log-signature computation (2 or 3).

  • n_jobs (int) – Number of threads to run in parallel in the internal per-window log_sig calls. -1 uses all available threads.

Example:

import pysiglib
import numpy as np

pysiglib.prepare_log_sig(3, 4, method=2)
ws = pysiglib.LogSigWindowStream(dimension=3, degree=4, window_size=20, stride=5)

path = np.random.randn(100, 3)
ws.push_batch(path)
window_logsigs = ws.sig()  # shape (num_windows, log_sig_length)

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