tensornn.activation.LecunTanh

class tensornn.activation.LecunTanh

Bases: Activation

The LeCun Tanh function is a scaled version of the tanh function, such that LecunTanh(1) = 1 and LecunTanh(-1) = -1

Methods

derivative

The derivative of the function.

forward

Calculate a forwards pass of this activation function.

source

__repr__()

Return repr(self).

derivative(inputs: Tensor) Tensor

The derivative of the function. Used for backpropagation.

Parameters:

inputs – get the derivative of the function at this input

Returns:

the derivative of the function at the given input

forward(inputs: Tensor) Tensor

Calculate a forwards pass of this activation function.

Parameters:

inputs – the outputs from the previous layer

Returns:

the inputs after they are passed through the activation function