Skip to content

Commit

Permalink
Merge pull request #254 from FluxML/a2/dropblock-update
Browse files Browse the repository at this point in the history
  • Loading branch information
darsnack authored Oct 16, 2023
2 parents eb3f9a4 + 3fd9cad commit d60172f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Metalhead"
uuid = "dbeba491-748d-5e0e-a39e-b530a07fa0cc"
version = "0.8.4"
version = "0.9.0"

[deps]
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
Expand Down
5 changes: 2 additions & 3 deletions src/layers/drop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,11 @@ ChainRulesCore.@non_differentiable _dropblock_checks(x, drop_block_prob, gamma_s

function (m::DropBlock)(x)
_dropblock_checks(x, m.drop_block_prob, m.gamma_scale)
return Flux._isactive(m) ?
dropblock(m.rng, x, m.drop_block_prob, m.block_size, m.gamma_scale) : x
return dropblock(m.rng, x, m.drop_block_prob * Flux._isactive(m, x), m.block_size, m.gamma_scale)
end

function Flux.testmode!(m::DropBlock, mode = true)
return (m.active = (isnothing(mode) || mode === :auto) ? nothing : !mode; m)
return (m.active = isnothing(Flux._tidy_active(mode)) ? nothing : !mode; m)
end

function DropBlock(drop_block_prob = 0.1, block_size::Integer = 7, gamma_scale = 1.0,
Expand Down

2 comments on commit d60172f

@darsnack
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/93516

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.0 -m "<description of version>" d60172f54c1ede0aa68f3eeb5eb84f822a3373c4
git push origin v0.9.0

Please sign in to comment.