Function tanh

  • Plot of tanh and its gradient

    Calculates:

    output = tanh(input)
    

    Gradient:

    inputGrad = outputGrad * (1.0 - tanh(input) * tanh(input))
    

    Parameters

    • input: Tensor

      the input tensor of any shape

    Returns Tensor

    the output tensor

Generated using TypeDoc