spd_learn.modules.BatchReNorm#
- class spd_learn.modules.BatchReNorm(num_features, momentum=0.9, rebias=True, renorm=False, device=None, dtype=None)[source]#
Bases:
ModuleBatch Re-Normalization.
This class implements Batch Re-Normalization, which is a variant of batch normalization that can be used in recurrent neural networks or as a Euclidean baseline for comparison with Riemannian batch normalization methods.
- Parameters:
- forward(input)[source]#
Forward pass of the Batch Re-Normalization layer.
- Parameters:
input (torch.Tensor) – Input tensor of shape (batch_size, [h,] d), where d is the number of features.
- Returns:
Normalized tensor of the same shape as the input.
- Return type: