Michael Abbott
Michael Abbott
The rules for `accumulate` and `foldl` don't compute anything for the `init` keyword. This can lead to silently wrong gradients, which is bad. Maybe this is a bigger problem than...
From https://github.com/JuliaDiff/ForwardDiff.jl/issues/547, note that the rule for `norm` gives zero gradient at x=0. It might be preferable to pick something like a sub-gradient? ``` julia> using Zygote, ForwardDiff, LinearAlgebra julia>...
When using ReverseDiff over Zygote, its tracked arrays will often be turned into arrays of TrackedReal: ```julia julia> using ReverseDiff, Zygote julia> _, back = pullback(x -> cumsum(x .^ 3),...
This doesn't seem to work, simple example: ```julia struct Over{T} den::T end (o::Over)(x) = x ./ o.den using ReverseDiff (o::Over)(x::ReverseDiff.TrackedArray) = ReverseDiff.track(o, x) ReverseDiff.@grad function (o::Over)(x) ReverseDiff.value(x) ./ o.den, Δ...
Minimal example: ```julia julia> ReverseDiff.gradient(x -> x[], fill(1.0)) ERROR: MethodError: getindex(::ReverseDiff.TrackedArray{Float64,Float64,0,Array{Float64,0},Array{Float64,0}}) is ambiguous. Candidates: getindex(t::ReverseDiff.TrackedArray, i::AbstractRange...) in ReverseDiff at /Users/me/.julia/packages/ReverseDiff/uy0uk/src/tracked.jl:284 getindex(t::ReverseDiff.TrackedArray, i::Colon...) in ReverseDiff at /Users/me/.julia/packages/ReverseDiff/uy0uk/src/tracked.jl:284 Possible fix, define getindex(::ReverseDiff.TrackedArray)...
Would be neat if this worked (from [this thread](https://discourse.julialang.org/t/inner-repeat-without-allocations/72204)): ```julia julia> X = randn(1000, 1000); julia> Y = zeros(2000, 2000); julia> Y .= repeat(X, inner=(2,2)); julia> @cast Y[(a,b), (c,d)] =...
This should work: ```julia julia> using TensorCast, Zygote julia> f1(x,y) = [x^2, x*y, y^2]; julia> x = 1:2; y = 1:4; julia> @cast out[i,j,k] := f1(x[i], y[j])[k] 2×4×3 transmute(stack(::Matrix{Vector{Int64}}), (2,...
``` julia> M = Array(reshape(1:12, 3,4)) 3×4 Matrix{Int64}: 1 4 7 10 2 5 8 11 3 6 9 12 julia> @cast R[r,(n,c)] := M[r,c]^2 (n in 1:3) ERROR: LoadError:...
On master the following syntax is understood: ``` julia> using TensorCast, ImageCore julia> mat = rand(1:10, 4, 3) ./ 10; julia> @cast _[k] := RGB(mat[k,:]...) 4-element Array{RGB{Float64},1} with eltype RGB{Float64}:...
This `@capture` replacement is 100x quicker, but fixing one pattern doesn't improve the package startup speed much.