28template<
typename AFloat>
29void TCudnn<AFloat>::ActivationFunctionForward(Tensor_t &
X,
EActivationFunction activFunct,
const ActivationDescriptor_t activationDescr,
const double coef,
const AFloat alpha,
const AFloat beta)
35 CUDNNCHECK(cudnnActivationForward(
X.GetCudnnHandle(),
38 X.GetTensorDescriptor(),
41 X.GetTensorDescriptor(),
45template <
typename AFloat>
46void TCudnn<AFloat>::ActivationFunctionForward(Tensor_t & Y,
const Tensor_t &
X,
EActivationFunction activFunct,
47 const ActivationDescriptor_t activationDescr,
const double coef,
48 const AFloat alpha,
const AFloat beta)
53 TCudnn<AFloat>::Copy(Y,
X);
57 CUDNNCHECK(cudnnActivationForward(
X.GetCudnnHandle(), activationDescr, &alpha,
X.GetTensorDescriptor(),
58 X.GetDataPointer(), &beta,
59 Y.GetTensorDescriptor(),
64template<
typename AFloat>
65void TCudnn<AFloat>::ActivationFunctionBackward(Tensor_t & dX,
const Tensor_t & Y,
66 const Tensor_t & dY,
const Tensor_t &
X,
68 const ActivationDescriptor_t activationDescr,
69 const AFloat alpha,
const AFloat beta)
79 CUDNNCHECK(cudnnActivationBackward(
X.GetCudnnHandle(),
82 Y.GetTensorDescriptor(),
84 dY.GetTensorDescriptor(),
86 X.GetTensorDescriptor(),
89 dX.GetTensorDescriptor(),
90 dX.GetDataPointer()));
void Copy(void *source, void *dest)
EActivationFunction
Enum that represents layer activation functions.
create variable transformations