Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


torch (version 0.3.0)

nn_leaky_relu: LeakyReLU module

Description

Applies the element-wise function:

Usage

nn_leaky_relu(negative_slope = 0.01, inplace = FALSE)

Arguments

negative_slope

Controls the angle of the negative slope. Default: 1e-2

inplace

can optionally do the operation in-place. Default: FALSE

Shape

  • Input: (N,) where * means, any number of additional dimensions

  • Output: (N,), same shape as the input

Details

LeakyReLU(x)=max(0,x)+negative\_slopemin(0,x) or

LeakyRELU(x)={x, if x0negative\_slope×x, otherwise 

Examples

Run this code
# NOT RUN {
if (torch_is_installed()) {
m <- nn_leaky_relu(0.1)
input <- torch_randn(2)
output <- m(input)

}
# }

Run the code above in your browser using DataLab