spd_learn.modules.GBWPatchCovariance#
- class spd_learn.modules.GBWPatchCovariance(n_patches=3, epsilon=1e-05, trace_normalize=True)[source]#
Bases:
ModuleEstimate chronological covariance tokens from learned time series.
See [Jin et al., 2026].
- Parameters:
Notes
Sample covariance uses divisor T-1. All samples are retained; earlier patches receive the remainder. Each patch needs at least two samples.
- forward(x)[source]#
Estimate regularized covariance tokens.
- Parameters:
x (torch.Tensor) – Features of shape (batch, features, time).
- Returns:
SPD tokens of shape (batch, n_patches, features, features).
- Return type: