Dropout layer
Examples
set.seed(1)
dropout <- mlx_dropout(p = 0.3)
x <- mlx_matrix(1:12, 3, 4)
mlx_forward(dropout, x)
#> mlx array [3 x 4]
#> dtype: float32
#> device: cpu
#> values:
#> [,1] [,2] [,3] [,4]
#> [1,] 0.000000 0.000000 10.00000 14.28571
#> [2,] 2.857143 7.142857 11.42857 15.71429
#> [3,] 0.000000 8.571428 0.00000 0.00000