Expand description
this module is dedicated to activation function Activation functions for neural networks and their components. These functions are often used to introduce non-linearity into the model, allowing it to learn more complex patterns in the data.
§Overview
This module works to provide a complete set of activation utilities for neural networks, manifesting in a number of traits, utilities, and other primitives used to define various approaches to activation functions.
Traits§
- Heavyside
- Linear
Activation - ReLU
- Rho
- The
Rhotrait defines a set of activation functions that can be applied to an implementor of theApplytrait. It provides methods for common activation functions such as linear, heavyside, ReLU, sigmoid, and tanh, along with their derivatives. The trait is generic over a typeU, which represents the data type of the input to the activation functions. The trait also inherits a type aliasCont<U>to allow for variance w.r.t. the outputs of defined methods. - RhoComplex
- The
RhoComplextrait is similar to theRhotrait in that it provides various activation functions for implementos of theApplytrait, however, instead of being truly generic over a typeU, it is generic over a typeUthat implements theComplexFloattrait. This enables the use of complex numbers in the activation functions, something particularly useful for signal-based workloads. - Sigmoid
- Softmax
- Softmax
Axis - Tanh
Functions§
- heavyside
- Heaviside activation function:
- linear
- the
linearmethod is essentially a passthrough method often used in simple models or layers where no activation is needed. - linear_
derivative - the
linear_derivativemethod always returns1as it is a simple, single variable function - relu
- the relu activation function:
- relu_
derivative - sigmoid
- the sigmoid activation function:
- sigmoid_
derivative - the derivative of the sigmoid function
- softmax
- Softmax function:
- softmax_
axis - Softmax function along a specific axis:
- tanh
- the tanh activation function:
- tanh_
derivative - the derivative of the tanh function