ceras
yet another deep learning engine
Namespaces | Functions
activation.hpp File Reference
#include "./operation.hpp"
#include "./tensor.hpp"
#include "./utils/range.hpp"
#include "./utils/better_assert.hpp"
#include "./utils/for_each.hpp"
#include "./utils/context_cast.hpp"

Go to the source code of this file.

Namespaces

 ceras
 

Functions

template<Expression Ex>
constexpr auto ceras::softmax (Ex const &ex) noexcept
 Softmax activation function, an unary operator. More...
 
template<Expression Ex>
auto ceras::selu (Ex const &ex) noexcept
 Scaled Exponential Linear Unit (SELU) activation function, an unary operator. If x>0, returns 1.0507 x; Otherwise, returns 1.67326*1.0507*(exp(x)-1) More...
 
template<Expression Ex>
auto ceras::softplus (Ex const &ex) noexcept
 Softplus function, an unary operator. Returns log(exp(x)+1). More...
 
template<Expression Ex>
auto ceras::softsign (Ex const &ex) noexcept
 Softsign function, an unary operator. Returns x / (abs(x) + 1). More...
 
template<Expression Ex>
auto ceras::sigmoid (Ex const &ex) noexcept
 Sigmoid function, an unary operator. Returns 1 / (exp(-x) + 1). More...
 
template<Expression Ex>
auto ceras::relu (Ex const &ex) noexcept
 Relu function, an unary operator. Returns x if positive, 0 otherwise. More...
 
template<Expression Ex>
auto ceras::relu6 (Ex const &ex) noexcept
 Rectified Linear 6 function, an unary operator. Returns min(max(features, 0), 6). More...
 
template<typename T >
requires std::floating_point< T > auto ceras::leaky_relu (T const factor=0.2) noexcept
 Leaky Rectified Linear function, an unary operator. Returns x if positive, alpha x otherwise. alpha defaults to 0.2. More...
 
template<Expression Ex>
auto ceras::negative_relu (Ex const &ex) noexcept
 
template<typename T = float>
requires std::floating_point< T > auto ceras::elu (T const alpha=1.0) noexcept
 Exponential Linear function, an unary operator. Returns x if positive, alpha* (exp(x)-1) otherwise. alpha defaults to 0.2. More...
 
template<Expression Ex>
auto ceras::exponential (Ex const &ex) noexcept
 Exponential function, an unary operator. Returns exp(x). More...
 
template<Expression Ex>
auto ceras::hard_sigmoid (Ex const &ex) noexcept
 Hard Sigmoid function, an unary operator. Piecewise linear approximation of the sigmoid function. More...
 
template<Expression Ex>
auto ceras::gelu (Ex const &ex) noexcept
 Gaussian Error function, an unary operator. GAUSSIAN ERROR LINEAR UNITS (GELUS) https://arxiv.org/pdf/1606.08415.pdf $f(x) = 0.5x (1 + tanh[\sqrt{2/\pi}(x + 0.044715x^3)])$ $df = x ( 1 + tanh[\sqrt{2/\pi}(x + 0.044715x^3)] ) + \sqrt(2/\pi) x sech^2[\sqrt(2/\pi) x (1+0.44715x^2) (1+0.134145x^2) ]$ where $sec^2(x) = 1 - tanh^2(x)$ derivative generated using service from https://www.symbolab.com/solver/derivative-calculator. More...
 
template<Expression Ex>
auto ceras::swish (Ex const &ex) noexcept
 Swish activation function. More...
 
template<Expression Ex>
auto ceras::silu (Ex const &ex) noexcept
 An alias name of activation swish. More...
 
template<Expression Ex>
auto ceras::crelu (Ex const &ex) noexcept
 Concatenated Rectified Linear Units, an activation function which preserves both positive and negative phase information while enforcing non-saturated non-linearity. More...
 
template<Expression Ex>
auto ceras::tank_shrink (Ex const &ex) noexcept
 Tank shrink function. More...
 
template<Expression Ex>
auto ceras::mish (Ex const &ex) noexcept
 Mish function. More...
 
template<Expression Ex>
auto ceras::lisht (Ex const &ex) noexcept
 Lisht function. More...