41#ifndef CHISEI_ACTIVATION_FUNCTION_HPP
42#define CHISEI_ACTIVATION_FUNCTION_HPP
72 return 1.0 / (1.0 + std::exp(-x));
104 return x > 0.0 ? x : 0.0;
123 return x > 0.0 ? 1.0 : 0.0;
Provides a collection of static methods for activation functions and their derivatives.
static constexpr double sigmoid_derivative(double x) noexcept
Computes the derivative of the Sigmoid function.
static constexpr double tanh_activation(double x) noexcept
Computes the Tanh (Hyperbolic Tangent) activation function.
static constexpr double sigmoid_activation(double x) noexcept
Computes the Sigmoid activation function.
static constexpr double relu_derivative(double x) noexcept
Computes the derivative of the ReLU function.
static constexpr double relu_activation(double x) noexcept
Computes the ReLU (Rectified Linear Unit) activation function.
static constexpr double tanh_derivative(double x) noexcept
Computes the derivative of the Tanh function.