lgatr.layers.mlp.mlp.GeoMLP

class lgatr.layers.mlp.mlp.GeoMLP(config, primitives)[source]

Bases: Module

MLP with a geometric product as the first nonlinear mixing step.

Similar to a regular MLP, except the first linear layer is replaced by a geometric bilinear (the geometric product). Inputs of shape (..., channels, 16) map to outputs of shape (..., channels, 16); hidden layers have shape (..., mlp_ratio * channels, 16).

Parameters:
forward(multivectors, scalars=None)[source]

Forward pass.

Parameters:
  • multivectors (Tensor) – Input multivectors of shape (..., mv_channels, 16).

  • scalars (Tensor | None) – Optional input scalars of shape (..., s_channels). If None, the scalar stream is bypassed and outputs_s is None.

Return type:

tuple[Tensor, Tensor | None]

Returns:

  • outputs_mv – Output multivectors of shape (..., mv_channels, 16).

  • outputs_s – Output scalars of shape (..., s_channels), or None if scalars is None.