spd_learn.functional.dropout_spd#
- spd_learn.functional.dropout_spd(input_mat: Tensor, p: float = 0.5, use_scaling: bool = True, epsilon: float | None = None, device=None, dtype=None) Tensor[source]#
Applies dropout to a batch of SPD matrices.
This function applies dropout to a batch of SPD matrices. Dropped channels have their diagonal set to epsilon and off-diagonal entries zeroed.
The input is expected to have shape (…, dim, dim).
- Parameters:
input_mat (Tensor) – Input SPD matrices with shape (…, dim, dim).
p (float, default=0.5) – Dropout probability.
use_scaling (bool, default=True) – If True, the output is scaled by 1 / (1 - p) to maintain the expected value.
epsilon (float, optional) – Value for the diagonal of dropped channels. If None, uses the value from the unified numerical configuration. Default: None.
device (torch.device, optional) – The device to move the output tensor to.
dtype (torch.dtype, optional) – The data type to cast the output tensor to.
- Returns:
Dropped-out SPD matrices of the same shape and dtype as the input.
- Return type:
Tensor