Python class
LayerNorm
LayerNorm
class max.nn.module_v3.norm.LayerNorm(dim, eps=1e-05, *, keep_dtype=True, elementwise_affine=True, use_bias=True)
Layer normalization over the last dimension.
Initialize LayerNorm.
-
Parameters:
-
- dim (int) – Size of the last dimension to normalize.
- eps (float) – Numerical stability constant.
- keep_dtype (bool) – Whether to preserve input dtype in computation.
- elementwise_affine (bool) – Whether to apply learned scale.
- use_bias (bool) – Whether to apply a bias. It’s only effective if elementwise_affine is True.
bias
forward()
forward(x)
Applies layer normalization to the input.
weight
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!