16 return 1.0f / (1.0f + expf(-a));
21 return a * ( 1.0f - a );
29 return max( a, 0.0f );
34 return a > 0.0f ? 1.0f : 0.0f;
50 return logf(1 + expf(a));
55 return 1.0f / (1.0f + expf(-a));
60 return a > 0.0f ? a + logf(1.0f + expf(-a)) : logf(1.0f + expf(a));
65 real_t expval = a > 50.0f ? 50.0f : a;
66 expval = expf(-expval);
67 return 1.0f / (1.0f + expval);
79 return 1.7159047*tanhf(0.66666667 *a);
85 return 0.66666667*1.7159047 -0.66666667/1.7159047*a*a;
98 return a < b ? 1.0f : 0.0f;
116 #endif // CXXNET_OP_H
Definition: cxxnet_op.h:43
Definition: cxxnet_op.h:63
Definition: cxxnet_op.h:32
scaled tanh, hard code the scale factor
Definition: cxxnet_op.h:77
float real_t
type that will be used for content
Definition: tensor_base.h:118
Rectified Linear Operation.
Definition: cxxnet_op.h:26
header file of tensor data structure and functions covention: this lib requires explicit memory alloc...
used for generate Bernoulli mask
Definition: cxxnet_op.h:96
Definition: cxxnet_op.h:19
Definition: cxxnet_op.h:71
used for generate element of power
Definition: cxxnet_op.h:103
Definition: cxxnet_op.h:83
Definition: cxxnet_op.h:38
Definition: cxxnet_op.h:48
Definition: cxxnet_op.h:108
Definition: cxxnet_op.h:14
Definition: cxxnet_op.h:58
Definition: cxxnet_op.h:53