powered by
Applies the element-wise function:
nn_celu(alpha = 1, inplace = FALSE)
the \(\alpha\) value for the CELU formulation. Default: 1.0
can optionally do the operation in-place. Default: FALSE
FALSE
Input: \((N, *)\) where * means, any number of additional dimensions
*
Output: \((N, *)\), same shape as the input
$$ \mbox{CELU}(x) = \max(0,x) + \min(0, \alpha * (\exp(x/\alpha) - 1)) $$
More details can be found in the paper Continuously Differentiable Exponential Linear Units.
if (torch_is_installed()) { m <- nn_celu() input <- torch_randn(2) output <- m(input) }
Run the code above in your browser using DataLab