-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Fixed NaN error in dilation #45
Conversation
Confirmed that this suppresses the symptoms I was seeing. Let's go ahead and add this workload to test suite (since the previous test didn't seem to catch this), remove the commented out As to why this was happening, I think this was due to us passing in the incorrect dimensions to the |
Uh oh, we need to fix gradients as well: # 2-length convolution with 1 channel in and 1 channel out
w = reshape(Float64[1, 1], (2, 1, 1))
# 128-length input vector with 1 channel and 1 batch.
x = reshape(Float64[1:128...], (128, 1, 1))
# Do the convolution (this doesn't have any NaN's)
y = NNlib.conv(x, w; dilation = 2)
@test !any(isnan.(y))
# Generate random upstream derivative
dy = randn(size(y))
# Calculate backprop for w
dws = []
for idx in 1:1000
dw = NNlib.∇conv_filter(dy, x, w; dilation=2)
push!(dws, dw)
end
# Calculate backprop for x
dxs = []
for idx in 1:1000
dx = NNlib.∇conv_data(dy, x, w; dilation=2)
push!(dxs, dx)
end
@show any([any(isnan.(dw)) for dw in dws])
@show any([any(isnan.(dx)) for dx in dxs]) In my experiments, |
|
Yep, that's great! Thanks Tejan! Can you add some of these workloads as test cases in the test suite, so that we can be sure to not run into these problems in the future? I can confirm that these changes fix my |
Thanks! I'm getting segfaults on 0.7, so hopefully this will address those. |
Missing Identity Activation Import
Missing Identity Activation Import
@staticfloat please review