ChainRules.jl
ChainRules.jl copied to clipboard
forward and reverse mode automatic differentiation primitives for Julia Base + StdLibs
Initial code for closing #640. I'm open to changing what it checks, but this seems like any easy way to minimize breaking changes for now.
In relation to other comments [here](https://github.com/invenia/Nabla.jl/issues/216) and [here](https://github.com/invenia/Nabla.jl/pull/217) I think we should re-add support for `getproperty(::Tangent{
We are missing rules for `cov`, which makes Zygote sad because `cov` internally mutates arrays. ```julia julia> using Zygote julia> y = rand(2, 50) 2×50 Matrix{Float64}: 0.400221 0.162725 0.16816 0.989187...
At least for me, ChainRules failed to build on Julia v1.7.1 after pulling the latest changes from #597 last night. The error messages (sorry I didn't copy) mentioned that the...
We have rules for `mean`, except for `mean(f, x; dims)` which is new as of Julia v1.3
This uses the `RuleConfig{>:HasReverseMode}` story to call back into AD to write a rule for `maximum(f, xs)`. It's much simplified from the first attempt: * On julia 1.7+, for a...
I was recently reminded that some number types are not even associative under multiplication, e.g. `Quaternions.Octonion`. So fixes like #504, #540, which would support numbers that don't commute under multiplication,...
This seems correct?
Minimum working example: ```julia f(x) = sum(sum(reinterpret(SVector{size(x, 1), eltype(x)}, x))) Zygote.gradient(f, rand(3, 10)) ``` ``` ERROR: Need an adjoint for constructor Base.ReinterpretArray{SVector{3, Float64}, 2, Float64, Matrix{Float64}, false}. Gradient is of...