Is it possible to auto-diff the following:
julia> function mynorm(x)
sqrt(sum(x^2 for x in x))
end
mynorm (generic function with 1 method)
julia> mynorm([1,2,3])
3.7416573867739413
Or more generally, differentiate code with comprehensions ([x^2 for x in x]), minimum, etc.
This is hard since Generator uses anonymous functions.
map and broadcast also have this issue when passed an anonymous function. It's possible there's a work around by making a type BroadcastedDualVector that turns all the relevant function calls into broadcasted versions.
Is it possible to auto-diff the following:
Or more generally, differentiate code with comprehensions (
[x^2 for x in x]),minimum,etc.This is hard since
Generatoruses anonymous functions.mapandbroadcastalso have this issue when passed ananonymousfunction. It's possible there's a work around by making a typeBroadcastedDualVectorthat turns all the relevant function calls into broadcasted versions.