-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
add var/std gradient wrt kw mean #478
base: master
Are you sure you want to change the base?
Conversation
looks fine and tests are exhaustive, merge? |
@chengchingwen is this giving warnings as you seem to mention in #446 (comment)? |
@CarloLucibello yes, the warnings are still there. |
if we want to avoid those warnings, we need to avoid using |
Defining internal methods like so seems sketchy. The adjoint definition from ChainRules as well as within zygote can handle it. The adjoint can accept kwargs |
I don't really get what you mean. The current |
Let me rephrase that, we don't want to differentiate kwargs here rather let those be passed to the functions appropriately. |
But the default |
Hi, is there any update on this? Is there a plan for that to be supported? |
What's an example of when this would matter, and would give correct results? On simple things, and the example from here: #446 (comment) it gives zero. With julia> gradient([1,2,3]) do x
m = mean(x)
std(x; mean=m)
end
backmean = -0.0
([-0.5, 0.0, 0.5],)
julia> function normalise(x::AbstractArray; dims=1)
μ′ = mean(x, dims = dims)
σ′ = std(x, dims = dims, mean = μ′, corrected=false)
return (x .- μ′) ./ σ′
end
normalise (generic function with 1 method)
julia> gradient(x -> sum(sin, normalise(x)), [1,2,3.0])
backmean = [-0.0]
([-0.2697761903106471, 0.5395523806212941, -0.2697761903106471],) Stumbled on this while thinking about JuliaDiff/ChainRules.jl#567 |
@mcabbott Yes, |
fix problem mentioned in #446