Class LayerNorm

java.lang.Object
ai.beestream.jitnn.nn.Module
ai.beestream.jitnn.nn.LayerNorm
All Implemented Interfaces:
AutoCloseable

public final class LayerNorm extends Module
LayerNorm over the last axis, with weight 1 and bias 0 initially, like PyTorch's nn.LayerNorm.
  • Constructor Details

    • LayerNorm

      public LayerNorm(int features)
      LayerNorm over features values, with eps 1e-5 and a bias.
    • LayerNorm

      public LayerNorm(int features, float eps, boolean bias)
      LayerNorm over features values with the given eps, with or without a bias.
  • Method Details

    • weight

      public Tensor weight()
      The scale [features].
    • bias

      public Tensor bias()
      The shift [features], or null without one.
    • forward

      public Tensor forward(Tensor x)
      Description copied from class: Module
      Applies the module to x.
      Specified by:
      forward in class Module