![]() |
Chisei v1.0
Lightweight AI/ML Framework
|
Provides a collection of static methods for activation functions and their derivatives. More...
#include <activation_functions.hpp>
Static Public Member Functions | |
static constexpr double | sigmoid_activation (double x) noexcept |
Computes the Sigmoid activation function. | |
static constexpr double | sigmoid_derivative (double x) noexcept |
Computes the derivative of the Sigmoid function. | |
static constexpr double | relu_activation (double x) noexcept |
Computes the ReLU (Rectified Linear Unit) activation function. | |
static constexpr double | relu_derivative (double x) noexcept |
Computes the derivative of the ReLU function. | |
static constexpr double | tanh_activation (double x) noexcept |
Computes the Tanh (Hyperbolic Tangent) activation function. | |
static constexpr double | tanh_derivative (double x) noexcept |
Computes the derivative of the Tanh function. | |
This class includes commonly used activation functions such as Sigmoid, ReLU, and Tanh, along with their derivatives. All methods are static, making them accessible without instantiating the class.
Definition at line 57 of file activation_functions.hpp.
|
inlinestaticconstexprnoexcept |
The ReLU function is defined as:
\[ f(x) = \max(0, x) \]
x | The input value. |
Definition at line 103 of file activation_functions.hpp.
|
inlinestaticconstexprnoexcept |
The derivative of the ReLU function is:
\[ f'(x) = \begin{cases} 1 & \text{if } x > 0 \\ 0 & \text{if } x \leq 0 \end{cases} \]
x | The input value. |
Definition at line 122 of file activation_functions.hpp.
|
inlinestaticconstexprnoexcept |
The Sigmoid function is defined as:
\[ f(x) = \frac{1}{1 + e^{-x}} \]
x | The input value. |
Definition at line 71 of file activation_functions.hpp.
|
inlinestaticconstexprnoexcept |
The derivative of the Sigmoid function is:
\[ f'(x) = x \cdot (1 - x) \]
This assumes that the input x
is the output of the Sigmoid function.
x | The input value (expected to be Sigmoid output). |
Definition at line 88 of file activation_functions.hpp.
|
inlinestaticconstexprnoexcept |
The Tanh function is defined as:
\[ f(x) = \tanh(x) \]
x | The input value. |
Definition at line 137 of file activation_functions.hpp.
|
inlinestaticconstexprnoexcept |
The derivative of the Tanh function is:
\[ f'(x) = 1 - x^2 \]
This assumes that the input x
is the output of the Tanh function.
x | The input value (expected to be Tanh output). |
Definition at line 154 of file activation_functions.hpp.