From d6608682fcbad1689b1466a325cb7f8de5352534 Mon Sep 17 00:00:00 2001 From: thebhatman Date: Tue, 5 Mar 2019 16:18:50 +0530 Subject: [PATCH] Suggested changes made --- src/layers/normalise.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/layers/normalise.jl b/src/layers/normalise.jl index cc222bf9..f4e0f186 100644 --- a/src/layers/normalise.jl +++ b/src/layers/normalise.jl @@ -61,12 +61,12 @@ end function (a::AlphaDropout)(x) a.active || return x - α = -1.75813631 - noise = randn(Float64, size(x.data)) - x.data .= x.data .* (noise .> (1 - a.p)) + α .* (noise .<= (1 - a.p)) + α = eltype(x)(-1.75813631) + noise = randn(eltype(x), size(x)) + x = @. x*(noise .> (1 - a.p)) + α .* (noise .<= (1 - a.p)) A = (a.p + a.p * (1 - a.p) * α ^ 2)^0.5 B = -A * α * (1 - a.p) - x.data .= A .* x.data .+ B + x = @. A .* x .+ B return x end