Chisei v1.0
Lightweight AI/ML Framework
Loading...
Searching...
No Matches
chisei::ActivationFunctions Class Referencefinal

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.
 

Detailed Description

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.

Member Function Documentation

◆ relu_activation()

static constexpr double chisei::ActivationFunctions::relu_activation ( double  x)
inlinestaticconstexprnoexcept

The ReLU function is defined as:

\[ f(x) = \max(0, x) \]

Parameters
xThe input value.
Returns
The computed ReLU value.

Definition at line 103 of file activation_functions.hpp.

◆ relu_derivative()

static constexpr double chisei::ActivationFunctions::relu_derivative ( double  x)
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} \]

Parameters
xThe input value.
Returns
The computed derivative value.

Definition at line 122 of file activation_functions.hpp.

◆ sigmoid_activation()

static constexpr double chisei::ActivationFunctions::sigmoid_activation ( double  x)
inlinestaticconstexprnoexcept

The Sigmoid function is defined as:

\[ f(x) = \frac{1}{1 + e^{-x}} \]

Parameters
xThe input value.
Returns
The computed Sigmoid value.

Definition at line 71 of file activation_functions.hpp.

◆ sigmoid_derivative()

static constexpr double chisei::ActivationFunctions::sigmoid_derivative ( double  x)
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.

Parameters
xThe input value (expected to be Sigmoid output).
Returns
The computed derivative value.

Definition at line 88 of file activation_functions.hpp.

◆ tanh_activation()

static constexpr double chisei::ActivationFunctions::tanh_activation ( double  x)
inlinestaticconstexprnoexcept

The Tanh function is defined as:

\[ f(x) = \tanh(x) \]

Parameters
xThe input value.
Returns
The computed Tanh value.

Definition at line 137 of file activation_functions.hpp.

◆ tanh_derivative()

static constexpr double chisei::ActivationFunctions::tanh_derivative ( double  x)
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.

Parameters
xThe input value (expected to be Tanh output).
Returns
The computed derivative value.

Definition at line 154 of file activation_functions.hpp.


The documentation for this class was generated from the following file: