
Hyperbolic tangent activation (Geron Ch 10, morie.fn hmtanh)
Source:R/geron_ml2_native.R
morie_geron_tanh.RdHyperbolic tangent activation (Geron Ch 10, morie.fn hmtanh)
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_tanh(V)
#> $a
#> [1] 0.7615942 0.9640276 0.9950548 0.9993293 0.9999092 0.9999877 0.9999983
#> [8] 0.9999998
#>
#> $grad
#> [1] 4.199743e-01 7.065082e-02 9.866037e-03 1.340951e-03 1.815832e-04
#> [6] 2.457655e-05 3.326109e-06 4.501406e-07
#>
#> $estimate
#> [1] 0.9649876
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "Hyperbolic tangent activation with elementwise derivative 1 - tanh^2"
#>