Made lambda and alpha of eltype(x)

This commit is contained in:
Manjunath Bhat 2019-03-07 23:42:38 +05:30 committed by GitHub
parent 47c1324476
commit c6e51f5cc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,8 +61,8 @@ end
function (a::AlphaDropout)(x)
a.active || return x
λ = 1.0507009873554804934193349852946
α = 1.6732632423543772848170429916717
λ = eltype(x)(1.0507009873554804934193349852946)
α = eltype(x)(1.6732632423543772848170429916717)
α1 = eltype(x)(-λ*α)
noise = randn(eltype(x), size(x))
x = @. x*(noise > (1 - a.p)) + α1 * (noise <= (1 - a.p))