Tangent hyperbolic activation function. Same as the intrinsic tanh, but must be defined here so that we can use procedure pointer with it.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | x(:) |
pure function tanhf(x) result(res)
!! Tangent hyperbolic activation function.
!! Same as the intrinsic tanh, but must be
!! defined here so that we can use procedure
!! pointer with it.
real(rk), intent(in) :: x(:)
real(rk) :: res(size(x))
res = tanh(x)
end function tanhf