spd_learn.functional.bwcm_mean#
- spd_learn.functional.bwcm_mean(X: Tensor, weights: Tensor | None = None, *, theta: float = 0.5, dim: int = 0, keepdim: bool = False) Tensor#
Compute closed-form Fréchet mean in Power-Cholesky coordinates.
- Parameters:
X (torch.Tensor) – SPD matrices of shape (…, n, n) with at least 3 dims.
weights (torch.Tensor, optional) – Weights along dim, normalized to sum to 1.
theta (float, default=0.5) – Power parameter (\(\theta \neq 0\)).
dim (int, default=0) – Batch dimension along which mean is computed.
keepdim (bool, default=False) – Whether to retain dim.
- Returns:
Weighted Fréchet mean SPD matrix.
- Return type: