Class Tanh

java.lang.Object
deepnetts.net.layers.activation.Tanh
All Implemented Interfaces:
ActivationFunction, Serializable, Consumer<Tensor>

public final class Tanh extends Object implements ActivationFunction, Serializable
Hyperbolic tangens activation function
Author:
zoran
See Also:
  • Constructor Details

    • Tanh

      public Tanh()
  • Method Details

    • getValue

      public float getValue(float x)
      Description copied from interface: ActivationFunction
      Returns the value of activation function for specified input x
      Specified by:
      getValue in interface ActivationFunction
      Parameters:
      x - input for activation
      Returns:
      value of activation function
    • getPrime

      public float getPrime(float y)
      Description copied from interface: ActivationFunction
      Returns the first derivative of activation function for specified output y
      Specified by:
      getPrime in interface ActivationFunction
      Parameters:
      y - output of activation function
      Returns:
      first derivative of activation function
    • apply

      public void apply(Tensor3D tensor, int channel)
      Specified by:
      apply in interface ActivationFunction
    • apply

      public void apply(Tensor4D tensor, int batchIdx)
      Specified by:
      apply in interface ActivationFunction
    • apply

      public void apply(Tensor tensor, int from, int to)
      Specified by:
      apply in interface ActivationFunction