-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix default noise level for NoiseAugmentation
#179
Conversation
Breaking: rename kwarg to `std`.
renamed arg was optional, not a kwargs
The fixed default of julia> d = Normal(0, 1)
Normal{Float64}(μ=0.0, σ=1.0)
julia> function sample_range(n) # of normalized n-dim. input
e = extrema(rand(d, n))
return e[2] - e[1]
end
sample_range (generic function with 2 methods)
julia> mean(sample_range(224*224*3) for _ in 1:1000)
8.939849898946928
julia> mean(sample_range(224*224*3) for _ in 1:1000)
8.959057153975865
julia> mean(sample_range(224*224*3) for _ in 1:1000)
8.943506279873574 scaled by 10-20%, |
While the actual noise might be similar to the recommended level over the entire dataset, the original intention of Smoothgrad as I read it was to have a constant signal to noise ratio for each image, where they determine the noise ratio by looking at the maximum amplitude across the entire image and all channels. Whether this is the best way to get a measure of the signal amplitude and whether it makes sense to adjust the noise level per image rather than per dataset is up for discussion, but if the intention is to have a standardized implementation, this would be it if one were to base it on the text of the paper. It definitely makes sense to adjust the noise with respect to the data in some way, and if it’s per image it would make sense to bake it into the analyzer. Per dataset it’s reasonable to let the user enter it manually, though it has the downside of having less universal defaults. |
Yes, I hope the new docstring makes that clear. Since I will decouple |
The previous
std
was0.1
instead of the documented1.0
.A value of one is more in line with the recommendation from the SmoothGrad paper, which has been added to the docstring: