Class HardShrink

All Implemented Interfaces:
Serializable, Function<Tensor,Tensor>, Layer

public class HardShrink extends ActivationFunction
Hard Shrink activation function.
See Also:
  • Constructor Details

    • HardShrink

      public HardShrink()
      Constructor.
    • HardShrink

      public HardShrink(double lambda)
      Constructor.
      Parameters:
      lambda - The lambda value in the formulation.
  • Method Details

    • forward

      public Tensor forward(Tensor x)
      Description copied from interface: Layer
      Forward propagation (or forward pass) through the layer.
      Parameters:
      x - the input tensor.
      Returns:
      the output tensor.