Using a library method for hyperbolic tangent calculation. HT: Jiaqi Zhang

Math#tanh(double) is more robust than its manually coded equivalent. For
example, when z = -512, the former returns -1 whereas the latter returns
Double.NaN.
Force the declaration of all model input fields