Leaky ReLU activation
Examples
act <- mlx_leaky_relu(negative_slope = 0.1)
x <- as_mlx(matrix(c(-2, -1, 0, 1, 2), 5, 1))
mlx_forward(act, x)
#> mlx array [5 x 1]
#> dtype: float32
#> device: gpu
#> values:
#> [,1]
#> [1,] -0.2
#> [2,] -0.1
#> [3,] 0.0
#> [4,] 1.0
#> [5,] 2.0