nn_softsign function

Softsign module

Softsign module

Applies the element-wise function: [REMOVE_ME]\mboxSoftSign(x)=x1+x[REMOVEME2] \mbox{SoftSign}(x) = \frac{x}{ 1 + |x|} [REMOVE_ME_2]

nn_softsign()

Description

Applies the element-wise function:

\mboxSoftSign(x)=x1+x \mbox{SoftSign}(x) = \frac{x}{ 1 + |x|}

Shape

  • Input: (N,)(N, *) where * means, any number of additional dimensions
  • Output: (N,)(N, *), same shape as the input

Examples

if (torch_is_installed()) { m <- nn_softsign() input <- torch_randn(2) output <- m(input) }
  • Maintainer: Daniel Falbel
  • License: MIT + file LICENSE
  • Last published: 2025-02-14