Package ai.djl.nn.norm
Class LayerNorm.Builder
- java.lang.Object
-
- ai.djl.nn.norm.LayerNorm.Builder
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LayerNorm.Builderaxis(int... axis)List the axis over which the mean and variance will be calculated (alternative to normalizedShape).LayerNormbuild()Builds aLayerNormblock.LayerNorm.BuilderoptCenter(boolean val)If True, add offset of `beta` to normalized tensor.LayerNorm.BuilderoptEpsilon(float val)Sets the epsilon value to prevent division by 0.LayerNorm.BuilderoptScale(boolean val)If True, multiply result by `gamma`.
-
-
-
Method Detail
-
axis
public LayerNorm.Builder axis(int... axis)
List the axis over which the mean and variance will be calculated (alternative to normalizedShape).- Parameters:
axis- input axis over which the mean and variance will be calculated (if null all existing dimensions)- Returns:
- this Builder
-
optCenter
public LayerNorm.Builder optCenter(boolean val)
If True, add offset of `beta` to normalized tensor. Defaults to True.- Parameters:
val- True or False on whether to add and train offset value- Returns:
- this Builder
-
optScale
public LayerNorm.Builder optScale(boolean val)
If True, multiply result by `gamma`. Defaults to True;- Parameters:
val- True or False on whether to add and train scale value- Returns:
- this Builder
-
optEpsilon
public LayerNorm.Builder optEpsilon(float val)
Sets the epsilon value to prevent division by 0.- Parameters:
val- the epsilon value- Returns:
- this Builder
-
-