Minor update
This commit is contained in:
parent
ce6a1bf84f
commit
7ab9d8ed3d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user