Michael Abbott

Results 1143 comments of Michael Abbott

The first example works for me if I put it in a `let` block -- global variables are weird. But the second never seems to. Zygote v0.6.41, Julia nightly. ```julia...

Good digging. The `sum` pullback is awful. The one for ordinary arrays makes a `Fill`, which IIRC caused some weird interactions with CuArrays... we should consider simply deleting that completely....

> Removing the array sum adjoint entirely gives us this, ``` ERROR: LoadError: MethodError: objects of type Matrix{Float32} are not callable Use square brackets [] for indexing an Array. Stacktrace:...

Possible duplicate of #953 Notice that in this particular example, no derivatives with respect to inputs of `jacobian` are requested, so it could be ignored. But Zygote does not automatically...

Better example, I think: ```julia julia> Zygote.gradient(x -> sum(abs, x .* randn.()), ones(5)) ([2.366255991572848, 2.366255991572848, 2.366255991572848, 2.366255991572848, 2.366255991572848],) julia> Zygote.gradient(x -> sum(x .* randn.()), ones(5)) (Fill(0.16740972975253307, 5),) ``` From FillArrays's...

Not fixed by https://github.com/JuliaArrays/FillArrays.jl/pull/153, FWIW.

Could this be done as some `foldl` type operation? That's one way to convey that you are iterating once; I don't know whether that information is at present used well...

Yes, I hadn't tried but individual sparse vectors still seem like a lot of overhead, especially if (as is common) you are covering the whole array. Did you literally use...

I had a go... delaying when to make the sparse vector does help a little: ```julia julia> Zygote.∇getindex(x::AbstractVector, i::Tuple{T}) where {T (GotOne(x, i[1], dy), nothing) julia> struct GotOne{T,I,V} arr::T ind::I...

BTW this is not fixed, although ProjectTo on final results hides the problem in the example above. If the gradient needs to be passed to another pullback expecting an array,...