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 java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract BatchNormbuild()Builds the newBatchNorm.ToptAxis(int axis)Set the axis in which channel is specified.ToptCenter(boolean val)If True, add offset of `beta` to normalized tensor.ToptEpsilon(float val)Sets the epsilon value to prevent division by 0.ToptMomentum(float val)Set the momentum for moving average.ToptScale(boolean val)If True, multiply result by `gamma`.abstract Tself()Returns this {code Builder} object.
-
-
-
Method Detail
-
optAxis
public T optAxis(int axis)
Set the axis in which channel is specified. Defaults to 1.- Parameters:
axis- the axis in which channel is specified- Returns:
- this Builder
-
optCenter
public T 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 T 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 T optEpsilon(float val)
Sets the epsilon value to prevent division by 0.- Parameters:
val- the epsilon value- Returns:
- this Builder
-
optMomentum
public T optMomentum(float val)
Set the momentum for moving average.- Parameters:
val- the momentum for moving average- Returns:
- this Builder
-
self
public abstract T self()
Returns this {code Builder} object.- Returns:
- this
BaseBuilder
-
-