Minor update

This commit is contained in:
thebhatman 2019-06-13 18:59:03 +05:30
parent ce6a1bf84f
commit 7ab9d8ed3d

View File

@ -29,7 +29,7 @@ _dropout_kernel(y::T, p, q) where {T} = y > p ? T(1 / q) : T(0)
function dropout(x, p; dims = :)
istraining() || return x
y = similar(x)
y = similar(x, _dropout_shape(x, dims))
rand!(y)
y .= _dropout_kernel.(y, p, 1 - p)
return x .* y