Class LayerNorm.Builder

  • Enclosing class:
    LayerNorm

    public static class LayerNorm.Builder
    extends java.lang.Object
    The Builder to construct a LayerNorm.
    • Constructor Detail

      • Builder

        protected Builder()
    • 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