tensornn.activation.Activation

class tensornn.activation.Activation

Bases: ABC, TensorNNObject

Base activation class. All activation classes should inherit from this.

Methods

derivative

The derivative of the function.

forward

Calculate a forwards pass of this activation function.

source

__repr__()

Return repr(self).

abstractmethod 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

abstractmethod 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