Package ai.djl.nn.norm
Class BatchNorm.BaseBuilder<T extends BatchNorm.BaseBuilder<T>>
java.lang.Object
ai.djl.nn.norm.BatchNorm.BaseBuilder<T>
- Direct Known Subclasses:
BatchNorm.Builder,GhostBatchNorm.Builder
- Enclosing class:
- BatchNorm
public abstract static class BatchNorm.BaseBuilder<T extends BatchNorm.BaseBuilder<T>>
extends Object
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract BatchNormbuild()Builds the newBatchNorm.optAxis(int axis) Set the axis in which channel is specified.optCenter(boolean val) If True, add offset of `beta` to normalized tensor.optEpsilon(float val) Sets the epsilon value to prevent division by 0.optMomentum(float val) Set the momentum for moving average.optScale(boolean val) If True, multiply result by `gamma`.abstract Tself()Returns this {code Builder} object.
-
Field Details
-
axis
protected int axis -
epsilon
protected float epsilon -
momentum
protected float momentum -
center
protected boolean center -
scale
protected boolean scale
-
-
Constructor Details
-
BaseBuilder
protected BaseBuilder()
-
-
Method Details
-
optAxis
Set the axis in which channel is specified. Defaults to 1.- Parameters:
axis- the axis in which channel is specified- Returns:
- this Builder
-
optCenter
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
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
Sets the epsilon value to prevent division by 0.- Parameters:
val- the epsilon value- Returns:
- this Builder
-
optMomentum
Set the momentum for moving average.- Parameters:
val- the momentum for moving average- Returns:
- this Builder
-
build
Builds the newBatchNorm.- Returns:
- the new
BatchNorm
-
self
Returns this {code Builder} object.- Returns:
- this
BaseBuilder
-