38 #ifndef ROOT_TMVA_TActivationTanh
48 TMVA::TActivationTanh::TActivationTanh()
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 ... ...
virtual void MakeFunction(std::ostream &fout, const TString &fncName)
writes the sigmoid activation function source code
ClassImp(TMVA::TActivationTanh) TMVA
constructor for tanh sigmoid (normalized in [-1,1])
Double_t EvalDerivative(Double_t arg)
evaluate the derivative
Double_t Eval(Double_t arg)
evaluate the tanh
~TActivationTanh()
destructor