DLPrimitives
activation.hpp
1 #pragma once
2 #include <dlprim/tensor.hpp>
3 #include <dlprim/context.hpp>
4 namespace dlprim {
5 namespace core {
6 
10  void activation_forward(Tensor &x,Tensor &y,StandardActivations activation, ExecutionContext const &ec);
11 
15  void activation_backward(Tensor &dx,Tensor &dy,Tensor &y,StandardActivations activation, float factor, ExecutionContext const &ec);
16 
17 } // core
18 } // dlprim
void activation_forward(Tensor &x, Tensor &y, StandardActivations activation, ExecutionContext const &ec)
Appliy activation on X save to Y, Y can be same as X.
void activation_backward(Tensor &dx, Tensor &dy, Tensor &y, StandardActivations activation, float factor, ExecutionContext const &ec)
Backward aclivation computed dx = dx * factor + backward(y,dy)
Mane namespace.
Definition: context.hpp:9
StandardActivations
Parameterless Activations that can be embedded to general kernels like inner product or convolution...
Definition: definitions.hpp:266