Deepity
Ultra-fast, SIMD-accelerated Predictive Coding
Loading...
Searching...
No Matches
ActivationDispatch.h File Reference

Function-pointer types and ActivationType <-> function dispatch tables shared by every activation family. Forward-declares the concrete activation functions (defined in the sibling Relu.h/Gelu.h/Tanh.h/ Sigmoid.h/Linear.h) so the dispatchers below can take their addresses without depending on inclusion order. More...

Go to the source code of this file.

Namespaces

namespace  Deep
 This file exists to provide both Tensor.h and IComputeBackend.h with device types without introducing circular dependencies.

Typedefs

using Deep::ActivationFn = void (*)(float *, size_t)
 Pointer to an in-place activation function: f(buf, n).
using Deep::DerivativeFn = void (*)(float *, size_t, bool)
 Pointer to an in-place activation derivative: f(buf, n, activated).
using Deep::DerivativeFn2 = void (*)(float *RESTRICT, const float *RESTRICT, size_t)
 Pointer to a two-buffer activation derivative: reads src, writes the derivative into dst, leaving src untouched.

Functions

static void Deep::relu (float *, size_t) noexcept
 See Relu.h.
static void Deep::gelu (float *, size_t) noexcept
 See Gelu.h.
static void Deep::sigmoid (float *, size_t) noexcept
 See Sigmoid.h.
static void Deep::e_sigmoid (float *, size_t) noexcept
 See Sigmoid.h.
static void Deep::tanh (float *, size_t) noexcept
 See Tanh.h.
static void Deep::linear (float *, size_t) noexcept
 See Linear.h.
static void Deep::dRelu (float *, size_t, bool) noexcept
 See Relu.h.
static void Deep::dGelu (float *, size_t, bool) noexcept
 See Gelu.h.
static void Deep::dSigmoid (float *, size_t, bool) noexcept
 See Sigmoid.h.
static void Deep::d_eSigmoid (float *, size_t, bool) noexcept
 See Sigmoid.h.
static void Deep::dTanh (float *, size_t, bool) noexcept
 See Tanh.h.
static void Deep::dLinear (float *, size_t, bool) noexcept
 See Linear.h.
static void Deep::dReluInto (float *RESTRICT, const float *RESTRICT, size_t) noexcept
 See Relu.h.
static void Deep::dGeluInto (float *RESTRICT, const float *RESTRICT, size_t) noexcept
 See Gelu.h.
static void Deep::dSigmoidInto (float *RESTRICT, const float *RESTRICT, size_t) noexcept
 See Sigmoid.h.
static void Deep::d_eSigmoidInto (float *RESTRICT, const float *RESTRICT, size_t) noexcept
 See Sigmoid.h.
static void Deep::dTanhInto (float *RESTRICT, const float *RESTRICT, size_t) noexcept
 See Tanh.h.
static void Deep::dLinearInto (float *RESTRICT, const float *RESTRICT, size_t) noexcept
 See Linear.h.
static ActivationFn Deep::To_Fn (ActivationType type)
 Maps an ActivationType to its concrete function pointer.
static DerivativeFn Deep::To_dFn (ActivationType dType)
 Maps an ActivationType (a derivative variant, e.g. dRELU) to its concrete function pointer.
static DerivativeFn2 Deep::To_dFn2 (ActivationType dType)
 Dispatches to the two-buffer (dst, src, n) derivative variant for the given activation type – see DerivativeFn2.
static ActivationType Deep::To_AType (ActivationFn fn)
 Reverse lookup of To_Fn(): maps a function pointer back to its ActivationType, by identity comparison against every known activation function.
static ActivationType Deep::To_AType (DerivativeFn dfn)
 Same as the ActivationFn overload above, for derivative function pointers.

Detailed Description

Function-pointer types and ActivationType <-> function dispatch tables shared by every activation family. Forward-declares the concrete activation functions (defined in the sibling Relu.h/Gelu.h/Tanh.h/ Sigmoid.h/Linear.h) so the dispatchers below can take their addresses without depending on inclusion order.