Michael Abbott
Michael Abbott
A more minimal example is ```julia julia> using StaticArrays, ForwardDiff julia> ForwardDiff.gradient(norm, [0,0]) 2-element Vector{Float64}: 0.0 1.0 julia> ForwardDiff.gradient(norm, SA[0,0]) 2-element SVector{2, Float64} with indices SOneTo(2): NaN NaN ``` With...
Oh right, well spotted. The dual part is indeed zero: ```julia julia> sqrt_show(x) = sqrt(@show x); julia> ForwardDiff.gradient(x -> sqrt_show(sum(abs2, x)), [0,0]) x = Dual{ForwardDiff.Tag{var"#5#6", Int64}}(0,0,0) 2-element Vector{Float64}: NaN NaN...
Finite differencing just averages the two sides of `abs`, right? If it were doing anything smarter I'd give it less weight...
Great. I see that the implementation is here: https://github.com/JuliaDiff/ForwardDiff.jl/blob/43ef860cbb20e606a5f835db0b470855c0eb22b7/src/partials.jl#L93-L121 Is it obvious why this test `!isfinite(x) && iszero(partials)` not just `iszero(partials)`? And if both are needed, why `&&` not `&`?...
The concern would be if `x==[0,0]` wasn't the optimum, then you could get stuck there. And you needn't initialise there, you could for instance be adding some noise & restricting,...
This no longer gives an error. But if `A` is not symmetric, it gives wrong results, as seen in [this discourse thread](https://discourse.julialang.org/t/correct-way-to-compose-reversediff-and-forwarddiff/83708/7): ```julia julia> const A3 = [1.0 2.0; 7.0...
The logic is roughly that `@tullio z := x[i] |> f` can equally well be `z = (@tullio _ := x[i]) |> f`, since it produces just one number. While...
I'll look when next I'm down in there. There's some terrifying code I meant to straighten out for deciding if it can differentiate `y[i] := f _/n` between parsing it...
The second issue in #115 was about fixing indices on the LHS within shifts. Toy example which now works: ```julia A = zeros(Int, 3,4); for r in 2:4 @tullio A[$r-1,...
Would be nice. Instead of depending on StaticArrays, you could probably just specify abstract types, something like this: ``` function ChainRules.rrule(::typeof(reinterpret), ::Type{T}, x::AbstractArray{S}) where {T