37 static inline void relu(
float *,
size_t)
noexcept;
39 static inline void gelu(
float *,
size_t)
noexcept;
41 static inline void sigmoid(
float *,
size_t)
noexcept;
43 static inline void e_sigmoid(
float *,
size_t)
noexcept;
45 static inline void tanh(
float *,
size_t)
noexcept;
47 static inline void linear(
float *,
size_t)
noexcept;
50 static inline void dRelu(
float *,
size_t,
bool)
noexcept;
52 static inline void dGelu(
float *,
size_t,
bool)
noexcept;
54 static inline void dSigmoid(
float *,
size_t,
bool)
noexcept;
56 static inline void d_eSigmoid(
float *,
size_t,
bool)
noexcept;
58 static inline void dTanh(
float *,
size_t,
bool)
noexcept;
60 static inline void dLinear(
float *,
size_t,
bool)
noexcept;
The RESTRICT portability macro shared by every activation header. Split out so each per-activation he...
#define RESTRICT
Portability macro for the C++ restrict pointer qualifier (MSVC spells it differently from everyone el...
Definition ActivationMacros.h:16
Just the ActivationType enum, deliberately split out of Activations.h – zero dependency on <immintrin...
This file exists to provide both Tensor.h and IComputeBackend.h with device types without introducing...
Definition Backend.cpp:10
static void sigmoid(float *, size_t) noexcept
See Sigmoid.h.
static void d_eSigmoidInto(float *RESTRICT, const float *RESTRICT, size_t) noexcept
See Sigmoid.h.
static void d_eSigmoid(float *, size_t, bool) noexcept
See Sigmoid.h.
static ActivationType To_AType(ActivationFn fn)
Reverse lookup of To_Fn(): maps a function pointer back to its ActivationType, by identity comparison...
Definition ActivationDispatch.h:152
void(*)(float *RESTRICT, const float *RESTRICT, size_t) DerivativeFn2
Pointer to a two-buffer activation derivative: reads src, writes the derivative into dst,...
Definition ActivationDispatch.h:27
static void linear(float *, size_t) noexcept
See Linear.h.
static void dLinear(float *, size_t, bool) noexcept
See Linear.h.
static void dGelu(float *, size_t, bool) noexcept
See Gelu.h.
ActivationType
Identifies an activation function or its derivative, for dispatch tables and layer/backend APIs that ...
Definition ActivationType.h:25
@ TANH
Definition ActivationType.h:34
@ eSIGMOID
Definition ActivationType.h:32
@ dGELU
Definition ActivationType.h:29
@ dSIGMOID
Definition ActivationType.h:31
@ dTANH
Definition ActivationType.h:35
@ GELU
Definition ActivationType.h:28
@ d_eSIGMOID
Definition ActivationType.h:33
@ LINEAR
Definition ActivationType.h:36
@ SIGMOID
Definition ActivationType.h:30
@ NONE
Definition ActivationType.h:38
@ RELU
Definition ActivationType.h:26
@ dLINEAR
Definition ActivationType.h:37
@ dRELU
Definition ActivationType.h:27
static void dLinearInto(float *RESTRICT, const float *RESTRICT, size_t) noexcept
See Linear.h.
static void tanh(float *, size_t) noexcept
See Tanh.h.
static void gelu(float *, size_t) noexcept
See Gelu.h.
static void relu(float *, size_t) noexcept
See Relu.h.
static void dSigmoidInto(float *RESTRICT, const float *RESTRICT, size_t) noexcept
See Sigmoid.h.
void(*)(float *, size_t, bool) DerivativeFn
Pointer to an in-place activation derivative: f(buf, n, activated).
Definition ActivationDispatch.h:20
static void dReluInto(float *RESTRICT, const float *RESTRICT, size_t) noexcept
See Relu.h.
static DerivativeFn To_dFn(ActivationType dType)
Maps an ActivationType (a derivative variant, e.g. dRELU) to its concrete function pointer.
Definition ActivationDispatch.h:102
static void dSigmoid(float *, size_t, bool) noexcept
See Sigmoid.h.
static void dRelu(float *, size_t, bool) noexcept
See Relu.h.
static void dTanhInto(float *RESTRICT, const float *RESTRICT, size_t) noexcept
See Tanh.h.
static void e_sigmoid(float *, size_t) noexcept
See Sigmoid.h.
static void dTanh(float *, size_t, bool) noexcept
See Tanh.h.
static ActivationFn To_Fn(ActivationType type)
Maps an ActivationType to its concrete function pointer.
Definition ActivationDispatch.h:77
void(*)(float *, size_t) ActivationFn
Pointer to an in-place activation function: f(buf, n).
Definition ActivationDispatch.h:18
static void dGeluInto(float *RESTRICT, const float *RESTRICT, size_t) noexcept
See Gelu.h.
static DerivativeFn2 To_dFn2(ActivationType dType)
Dispatches to the two-buffer (dst, src, n) derivative variant for the given activation type – see Der...
Definition ActivationDispatch.h:126