nn_tanh: Tanh module

Description Usage Details Shape Examples

Description

Applies the element-wise function:

Usage

1

Details

\mbox{Tanh}(x) = \tanh(x) = \frac{\exp(x) - \exp(-x)} {\exp(x) + \exp(-x)}

Shape

Examples

1
2
3
4
5
6
if (torch_is_installed()) {
m <- nn_tanh()
input <- torch_randn(2)
output <- m(input)

}

torch documentation built on Oct. 7, 2021, 9:22 a.m.