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
The Builder to construct a BatchNorm type of Block.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    protected boolean
     
    protected float
     
    protected float
     
    protected boolean
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract BatchNorm
    Builds the new BatchNorm.
    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 T
    Returns this {code Builder} object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      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
    • build

      public abstract BatchNorm build()
      Builds the new BatchNorm.
      Returns:
      the new BatchNorm
    • self

      public abstract T self()
      Returns this {code Builder} object.
      Returns:
      this BaseBuilder