Skip to content
New issue

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

grad_conv! computes wrong answer #538

Closed
wsmoses opened this issue Sep 26, 2023 · 1 comment · Fixed by #539
Closed

grad_conv! computes wrong answer #538

wsmoses opened this issue Sep 26, 2023 · 1 comment · Fixed by #539

Comments

@wsmoses
Copy link
Contributor

wsmoses commented Sep 26, 2023

julia> dx, dy, cache_w = ([0.17;;; 0.19;;; 0.23], [0.11;;; 0.13;;; 0.15], [1.0;;;])
([0.17;;; 0.19;;; 0.23], [0.11;;; 0.13;;; 0.15], [1.0;;;])

julia> NNlib.∇conv_data!(dx, dy, cache_w, cdims; alpha=1.0, beta=1.0)
1×1×3 Array{Float64, 3}:
[:, :, 1] =
 0.11

[:, :, 2] =
 0.13

[:, :, 3] =
 0.15

This is wrong. grad_conv should do dx = alpha * dx + beta * grad. Here the correct result should be the original dx .+ dy, but instead just has dy.

@wsmoses
Copy link
Contributor Author

wsmoses commented Sep 26, 2023

I traced the issue down to a flawed function ∇conv_data_im2col!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant