Skip to content

Commit

Permalink
fix incorrect logdet adjoint
Browse files Browse the repository at this point in the history
  • Loading branch information
marius311 committed Apr 15, 2021
1 parent dd1e07f commit efb618d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/autodiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Zygote.accum(f::BaseField, nt::NamedTuple{(:arr,:metadata)}) = (@assert(isnothin
@adjoint dot(f::Field{B1}, g::Field{B2}) where {B1,B2} = dot(f,g), Δ ->*B1(g), Δ*B2(f))
@adjoint (*)(f::Adjoint{<:Any,<:Field}, g::Field) = Zygote.pullback((f,g)->dot(f',g),f,g)
# ℝᴺˣᴺ -> ℝ¹
@adjoint logdet(L::ParamDependentOp, θ) = Zygote._pullback->logdet(L(...)), θ)
@adjoint logdet(L::ParamDependentOp, θ) = Zygote.pullback((L,θ)->logdet(L(θ)), L, θ)
@adjoint logdet(L::DiagOp) = logdet(L), Δ ->* Zfac(L) * pinv(L)',)

# basis conversion
Expand Down

0 comments on commit efb618d

Please sign in to comment.