mr2.nn.LayerNorm
- class mr2.nn.LayerNorm[source]
-
Layer normalization.
- __init__(n_channels: int | None, features_last: bool = False, cond_dim: int = 0) None[source]
Initialize the layer normalization.
- Parameters:
n_channels (
int|None) – Number of channels in the input tensor. IfNone, the layer normalization does not do an elementwise affine transformation.features_last (
bool, default:False) – IfTrue, the channel dimension is the last dimension.cond_dim (
int, default:0) – Number of channels in the conditioning tensor. If0, no adaptive scaling is applied.