ChainRules.jl
ChainRules.jl copied to clipboard
forward and reverse mode automatic differentiation primitives for Julia Base + StdLibs
I'm getting incorrect results when working with the [rrule for cholesky where A cholesky(Hermitian(a)).L , A)[1] # both of the following produce expected result Zygote.jacobian(a -> cholesky(Matrix(Hermitian(a))).L , A)[1] Zygote.jacobian(a...
OK, I admit I can't find a better title for this. But I feel this should be brought up. See previous related issues in #381 #380 #46 @GiggleLiu keeps wanting...
Can we safely detect if a primal function is going to hit a specific default and use that to change the logic in the `frule` or `rrule`? For example, the...
As identified by https://github.com/JuliaDiff/ChainRulesTestUtils.jl/pull/78, the pullbacks for `BLAS.gemm` and `BLAS.gemv` are type-unstable because a different `InplaceableThunk` is returned based on the value of the input parameters. For the `norm` functions,...
There are quite a few rules where mixing complex and real inputs will result in the cotangent of a real input being complex. I proposed in JuliaDiff/ChainRulesCore.jl#176 that the right...
There's some linear algebra optimisations implemented [here](https://github.com/GiggleLiu/BackwardsLinalg.jl) that we don't have. Nice blog post [here](https://giggleliu.github.io/2019/04/02/einsumbp.html)
I see in https://github.com/JuliaDiff/ChainRules.jl/blob/master/src/rulesets/LinearAlgebra/factorization.jl we use a fair bit of `A'` which is `adjoint`. In other places @simeonschaub has said we need to not use that, and to use `transpose`...
Transferred from https://github.com/FluxML/Zygote.jl/issues/773 There are some adjoints which repeat calculations in the backwards pass which can be avoided, for example. https://github.com/JuliaDiff/ChainRules.jl/blob/bb08bd80b5cee92947002547de1f54556a5e3ee7/src/rulesets/LinearAlgebra/dense.jl#L284-L310 This refactorizes A' and can be replaced with factorize...
@sethaxen wrote in https://github.com/JuliaDiff/ChainRules.jl/pull/279#pullrequestreview-506908830 > not allocate new conjugated matrices in the BLAS rules? e.g. in > > https://github.com/JuliaDiff/ChainRules.jl/blob/c877550430a3cb0f657f43ccbf4e64b13b7177a7/src/rulesets/LinearAlgebra/blas.jl#L134-L137 > , > we allocate a new matrix `A`, which I...
The following MWE does not inline when using intervals from `IntervalArithmetic.jl`: ```jl function fff(x, y) z, z_pullback = rrule(*, x, y) z̄ = one(x) _, r1, r2 = z_pullback(z̄) x̄...