62 if (arg > 4.97)
return 1;
63 if (arg < -4.97)
return -1;
64 float arg2 = arg * arg;
65 float a = arg * (135135.0f + arg2 * (17325.0f + arg2 * (378.0f + arg2)));
66 float b = 135135.0f + arg2 * (62370.0f + arg2 * (3150.0f + arg2 * 28.0f));
93 TString expr =
"tanh(x)\t\t (1-tanh()^2)";
102 fout <<
"double " << fncName <<
"(double x) const {" << std::endl;
103 fout <<
" // hyperbolic tan" << std::endl;
104 fout <<
" return tanh(x);" << std::endl;
105 fout <<
"}" << std::endl;
Double_t fast_tanh(Double_t arg)
a fast tanh approximation
TString GetExpression()
get expressions for the tanh and its derivative whatever that may be good for ... ...
TActivationTanh()
constructor for tanh sigmoid (normalized in [-1,1])
virtual void MakeFunction(std::ostream &fout, const TString &fncName)
writes the sigmoid activation function source code
Double_t EvalDerivative(Double_t arg)
evaluate the derivative
Tanh activation function for ANN.
Double_t Eval(Double_t arg)
evaluate the tanh
~TActivationTanh()
destructor
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b