Skip to content

Commit 8f7ef92

Browse files
bors[bot]darsnack
andauthored
Merge #1490
1490: Make Dropout docstring clear w.r.t. N-D dropout r=DhairyaLGandhi a=darsnack Make the docstring specify N-dimensional dropouts more clearly (i.e. so that people don't think we don't have `Dropout3d` etc.). ### PR Checklist - [x] ~~Tests are added~~ - [x] ~~Entry in NEWS.md~~ - [x] Documentation, if applicable - [x] ~~Final review from `@dhairyagandhi96` (for API changes).~~ Co-authored-by: Kyle Daruwalla <daruwalla@wisc.edu> Co-authored-by: Kyle Daruwalla <daruwalla.k.public@icloud.com>
2 parents 06d23b3 + 5cac6f6 commit 8f7ef92

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/layers/normalise.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ end
5151
5252
Dropout layer. In the forward pass, apply the [`Flux.dropout`](@ref) function on the input.
5353
54+
To apply dropout along certain dimension(s), specify the `dims` keyword.
55+
e.g. `Dropout(p; dims = 3)` will randomly zero out entire channels on WHCN input
56+
(also called 2D dropout).
57+
5458
Does nothing to the input once [`Flux.testmode!`](@ref) is `true`.
5559
"""
5660
mutable struct Dropout{F,D}
@@ -420,4 +424,4 @@ function Base.show(io::IO, l::GroupNorm)
420424
print(io, "GroupNorm($(join(size(l.β), ", "))")
421425
(l.λ == identity) || print(io, ", λ = $(l.λ)")
422426
print(io, ")")
423-
end
427+
end

0 commit comments

Comments
 (0)