spd_learn.models.SPDDecoderBlock#

class spd_learn.models.SPDDecoderBlock(in_features: int, out_features: int, eps: float = 0.0001, device=None, dtype=None)[source]#

Bases: Module

SPD Decoder Block via Bilinear Dimension Expansion.

This block performs dimensionality expansion from a latent SPD subspace to a higher-dimensional SPD space using BiMap (which applies semi-orthogonal projection and identity padding via BiMapIncreaseDim) followed by ReEig.

Parameters:
  • in_features (int) – Dimensionality of input latent SPD matrices.

  • out_features (int) – Target dimensionality of reconstructed SPD matrices.

  • eps (float, default=1e-4) – Eigenvalue rectification threshold.

  • device (torch.device, optional) – Device for layer parameters.

  • dtype (torch.dtype, optional) – Data type for layer parameters.

Examples

>>> import torch
>>> from spd_learn.models.spdnetae import SPDDecoderBlock
>>> dec = SPDDecoderBlock(in_features=8, out_features=16)
>>> Z = torch.eye(8).unsqueeze(0)
>>> Y = dec(Z)
>>> Y.shape
torch.Size([1, 16, 16])
forward(Z: Tensor) → Tensor[source]#

Forward pass of the SPD decoder block.