JuliaDiff / JuliaDiff/ForwardDiff.jl
inaccurate derivatives of matrix logarithm
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 1k
- Forks
- 160
- PR merge metrics
- No merged PRs in 30d
Description
The gradient of of the matrix valued function F(X) = log(X) or the Hessian of the scalar valued function f(X) = tr(X * log(X)) has an analytic form e.g. Equation (64) from https://arxiv.org/pdf/1906.00037.pdf.
I've hit a few cases where the derivatives I compute manually differ from ForwardDiff, one example is the bad_W in: https://gist.github.com/lkapelevich/8e4e4020cc56e13a0a42e73c4fa247d3
The code for the analytic form can become problematic if the values of some pair of eigenvalues in the input come close together. But this is not the case for the bad_W in the example, so I'm not sure what other sources of trouble to suspect.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the bad_W example from the linked gist and comparing its matrix-logarithm derivatives with ForwardDiff. Check the analytic derivative described in Equation (64) and identify why the results diverge despite the reported eigenvalue condition; done means the discrepancy is explained and the affected behavior is corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100