Silly error in Dropout corrected.
This commit is contained in:
parent
e9797408ec
commit
48ed93cdaa
@ -15,11 +15,12 @@ Does nothing to the input once in [`testmode!`](@ref).
|
|||||||
mutable struct Dropout{F}
|
mutable struct Dropout{F}
|
||||||
p::F
|
p::F
|
||||||
dims::Union{Colon, Int, NTuple{N, Int} where N}
|
dims::Union{Colon, Int, NTuple{N, Int} where N}
|
||||||
|
end
|
||||||
|
|
||||||
function Dropout(p; dims = :)
|
function Dropout(p; dims = :)
|
||||||
@assert 0 ≤ p ≤ 1
|
@assert 0 ≤ p ≤ 1
|
||||||
Dropout{typeof(p)}(p, dims)
|
Dropout{typeof(p)}(p, dims)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
_dropout_shape(s, ::Colon) = size(s)
|
_dropout_shape(s, ::Colon) = size(s)
|
||||||
_dropout_shape(s, dims) = tuple((i ∉ dims ? 1 : si for (i, si) ∈ enumerate(size(s)))...)
|
_dropout_shape(s, dims) = tuple((i ∉ dims ? 1 : si for (i, si) ∈ enumerate(size(s)))...)
|
||||||
|
Loading…
Reference in New Issue
Block a user