From e4d841227e1162544dcb878e557edd52b656260b Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Wed, 20 Jan 2021 12:10:53 -0800 Subject: [PATCH 1/3] Increment ChainRules version bound --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 66d5b6f59..ae9ab385d 100644 --- a/Project.toml +++ b/Project.toml @@ -22,7 +22,7 @@ ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444" [compat] AbstractFFTs = "0.5, 1.0" -ChainRules = "0.7.47" +ChainRules = "0.7.49" DiffRules = "1.0" FillArrays = "0.8, 0.9, 0.10, 0.11" ForwardDiff = "0.10" From 95222534b0dc3ac50f9439286211f742167c4584 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Wed, 20 Jan 2021 12:11:05 -0800 Subject: [PATCH 2/3] Remove exp rules --- src/lib/array.jl | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/lib/array.jl b/src/lib/array.jl index 102dc09c9..c9d6fdb2a 100644 --- a/src/lib/array.jl +++ b/src/lib/array.jl @@ -555,29 +555,6 @@ Base.@propagate_inbounds function _pairdiffquotmat(f, n, x, fx, dfx, d²fx = not return Δfij.(Base.OneTo(n), Base.OneTo(n)') end -# Adjoint based on the Theano implementation, which uses the differential as described -# in Brančík, "Matlab programs for matrix exponential function derivative evaluation" -@adjoint exp(A::AbstractMatrix) = exp(A), function(F̄) - n = size(A, 1) - E = eigen(A) - w = E.values - ew = exp.(w) - X = _pairdiffquotmat(exp, n, w, ew, ew, ew) - V = E.vectors - VF = factorize(V) - Āc = (V * ((VF \ F̄' * V) .* X) / VF)' - Ā = isreal(A) && isreal(F̄) ? real(Āc) : Āc - return (Ā,) -end - -# The adjoint for exp(::AbstractArray) intercepts ChainRules' rrule for exp(::Hermitian), -# so we call it manually. This can be removed when the generic rule for exp is moved to -# ChainRules -@adjoint function exp(A::LinearAlgebra.RealHermSymComplexHerm) - Y, back = chain_rrule(exp, A) - return Y, Δ -> (back(Δ)[2],) -end - # Hermitian/Symmetric matrix functions that can be written as power series _realifydiag!(A::AbstractArray{<:Real}) = A function _realifydiag!(A) From 0d9a1c8d098e898daea9197a43a55dd237c67a82 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Wed, 20 Jan 2021 12:11:27 -0800 Subject: [PATCH 3/3] Increment version number --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index ae9ab385d..92abcc91c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Zygote" uuid = "e88e6eb3-aa80-5325-afca-941959d7151f" -version = "0.6.1" +version = "0.6.2" [deps] AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"