63 if (arg > 4.97)
return 1;
64 if (arg < -4.97)
return -1;
65 float arg2 = arg * arg;
66 float a = arg * (135135.0f + arg2 * (17325.0f + arg2 * (378.0f + arg2)));
67 float b = 135135.0f + arg2 * (62370.0f + arg2 * (3150.0f + arg2 * 28.0f));
94 TString expr =
"tanh(x)\t\t (1-tanh()^2)";
103 fout <<
"double " << fncName <<
"(double x) const {" << std::endl;
104 fout <<
" // hyperbolic tan" << std::endl;
105 fout <<
" return tanh(x);" << std::endl;
106 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 ... ...
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
Double_t Eval(Double_t arg)
evaluate the tanh
~TActivationTanh()
destructor
Abstract ClassifierFactory template that handles arbitrary types.
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