spd_learn.models.AttentionManifold#
- class spd_learn.models.AttentionManifold(in_features, out_features)[source]#
Bases:
ModuleManifold Attention Module.
This module implements an attention mechanism over a sequence of SPD matrices, where the operations are performed on the SPD manifold using the Log-Euclidean metric [Pan et al., 2022].
- Parameters:
- forward(x)[source]#
Forward pass of the manifold attention module.
- Parameters:
x (torch.Tensor) – Input tensor with shape (batch, num_patch, …) where … represents the dimensions of the SPD matrices.
- Returns:
Output tensor of shape (-1, out_features, out_features).
- Return type: