Rectified linear activation module
Examples
act <- mlx_relu()
x <- as_mlx(matrix(c(-1, 0, 2), 3, 1))
mlx_forward(act, x)
#> mlx array [3 x 1]
#> dtype: float32
#> device: gpu
#> values:
#> [,1]
#> [1,] 0
#> [2,] 0
#> [3,] 2
Rectified linear activation module
act <- mlx_relu()
x <- as_mlx(matrix(c(-1, 0, 2), 3, 1))
mlx_forward(act, x)
#> mlx array [3 x 1]
#> dtype: float32
#> device: gpu
#> values:
#> [,1]
#> [1,] 0
#> [2,] 0
#> [3,] 2