tanh method

List<double> tanh(
  1. List<double> val
)

Hyperbolic tangent activation function:

f(x) = tanh(x)

Implementation

List<double> tanh(List<double> val) {
  val.asMap().forEach((i, v) => val[i] = mathutils.tanh(val[i]));
  return val;
}