22#define TANH_IMPL_X vdt::fast_tanhf(x)
24#define TANH_IMPL_X tanh(x)
34template<
typename AFloat>
38 auto f = [](AFloat) {
return 1.0;};
43template<
typename AFloat>
46 auto f = [](AFloat
x) {
return (
x < 0.0) ? 0.0 :
x;};
51template<
typename AFloat>
55 auto f = [](AFloat
x) {
return (
x < 0.0) ? 0.0 : 1.0;};
60template<
typename AFloat>
63 auto f = [](AFloat
x) {
return 1.0 / (1.0 +
exp(-
x));};
68template<
typename AFloat>
72 auto f = [](AFloat
x) {
73 AFloat sig = 1.0 / (1.0 +
exp(-
x));
74 return sig * (1.0 - sig);
80template<
typename AFloat>
88template<
typename AFloat>
92 auto f = [](AFloat
x) {
100template<
typename AFloat>
103 auto f = [](AFloat
x) {
return fabs(
x);};
108template<
typename AFloat>
112 auto f = [](AFloat
x) {
113 return (
x < 0.0) ? -1.0 : 1.0;
119template<
typename AFloat>
122 auto f = [](AFloat
x) {
return x / (1 +
fabs(
x));};
127template<
typename AFloat>
131 auto f = [](AFloat
x) {
140template<
typename AFloat>
143 auto f = [](AFloat
x) {
return exp(-
x *
x);};
148template<
typename AFloat>
152 auto f = [](AFloat
x) {
return - 2.0 *
x *
exp(-
x *
x);};
static void SymmetricRelu(TCpuMatrix< Scalar_t > &B)
static void Gauss(TCpuMatrix< Scalar_t > &B)
static void SymmetricReluDerivative(TCpuMatrix< Scalar_t > &B, const TCpuMatrix< Scalar_t > &A)
static void Relu(TCpuMatrix< Scalar_t > &B)
static void SoftSign(TCpuMatrix< Scalar_t > &B)
static void TanhDerivative(TCpuMatrix< Scalar_t > &B, const TCpuMatrix< Scalar_t > &A)
static void SoftSignDerivative(TCpuMatrix< Scalar_t > &B, const TCpuMatrix< Scalar_t > &A)
static void IdentityDerivative(TCpuMatrix< Scalar_t > &B, const TCpuMatrix< Scalar_t > &A)
static void Tanh(TCpuMatrix< Scalar_t > &B)
static void Sigmoid(TCpuMatrix< Scalar_t > &B)
static void SigmoidDerivative(TCpuMatrix< Scalar_t > &B, const TCpuMatrix< Scalar_t > &A)
static void ReluDerivative(TCpuMatrix< Scalar_t > &B, const TCpuMatrix< Scalar_t > &A)
static void GaussDerivative(TCpuMatrix< Scalar_t > &B, const TCpuMatrix< Scalar_t > &A)
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
Abstract ClassifierFactory template that handles arbitrary types.