Tanh

public class Tanh

Hyperbolic tangent activation function.

For example:

     Operand<TFloat32> input = tf.constant(new float[]
                                        {-3.0f,-1.0f, 0.0f, 1.0f, 3.0f});
     Tanh<TFloat32> tanh = new Tanh<>(tf);
     Operand<TFloat32> result = tanh.call(input);
     // result = [-0.9950547f, -0.7615942f,  0.f,  0.7615942f,  0.9950547f]
 

Public Constructors

Tanh(Ops tf)
Creates a Hyperbolic tangent activation.

Public Methods

Operand<T>
call(Operand<T> input)
Gets the calculation operation for the activation.

Inherited Methods

Public Constructors

public Tanh (Ops tf)

Creates a Hyperbolic tangent activation.

Parameters
tf the TensorFlow Ops

Public Methods

public Operand<T> call (Operand<T> input)

Gets the calculation operation for the activation.

Parameters
input the input tensor
Returns
  • The operand for the activation