We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Our pooling layers don't deal well with degenerate inputs (e.g. ones()). MWE:
ones()
using Flux x = ones(10, 10, 1, 1) xp = param(x) y_hat = MaxPool((3,3), stride=(2,2))(xp) Flux.back!(sum(y_hat))
Which results in:
julia> xp.grad 10×10×1×1 Array{Float64,4}: [:, :, 1, 1] = 1.0 1.0 2.0 1.0 2.0 1.0 2.0 1.0 1.0 0.0 1.0 1.0 2.0 1.0 2.0 1.0 2.0 1.0 1.0 0.0 2.0 2.0 4.0 2.0 4.0 2.0 4.0 2.0 2.0 0.0 1.0 1.0 2.0 1.0 2.0 1.0 2.0 1.0 1.0 0.0 2.0 2.0 4.0 2.0 4.0 2.0 4.0 2.0 2.0 0.0 1.0 1.0 2.0 1.0 2.0 1.0 2.0 1.0 1.0 0.0 2.0 2.0 4.0 2.0 4.0 2.0 4.0 2.0 2.0 0.0 1.0 1.0 2.0 1.0 2.0 1.0 2.0 1.0 1.0 0.0 1.0 1.0 2.0 1.0 2.0 1.0 2.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Compare with adding a bit of noise to eliminate the degeneracy:
xp = param(x .+ 0.01.*randn(size(x)...)) y_hat = MaxPool((3,3), stride=(2,2))(xp) Flux.back!(sum(y_hat))
Which results in the proper output of prod(size(y_hat)) == sum(xp.grad) :
prod(size(y_hat)) == sum(xp.grad)
julia> xp.grad 10×10×1×1 Array{Float64,4}: [:, :, 1, 1] = 0.0 0.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
The text was updated successfully, but these errors were encountered:
Fixed by #94
Sorry, something went wrong.
No branches or pull requests
Our pooling layers don't deal well with degenerate inputs (e.g.
ones()
). MWE:Which results in:
Compare with adding a bit of noise to eliminate the degeneracy:
Which results in the proper output of
prod(size(y_hat)) == sum(xp.grad)
:The text was updated successfully, but these errors were encountered: