JuliaDiff / JuliaDiff/ChainRules.jl
Rules for det are not general and likely unstable
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 475
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
A = [1.0 1.0; 1.0 1.0]
det(A) * inv(A)
# ERROR: SingularException(2)
to be fair, the LU approach is remarkably resiliant...
A = [1.0 1.0; 1.0 1.0-1e-16]
det(A) * inv(A)
# 2×2 Matrix{Float64}:
# 1.0 -1.0
# -1.0 1.0
But I am nervous that this is too simple a special case to draw any conclusions.
Either way - it seems to me that an implementation that always works and is guaranteed numerically stable is preferrable. If the maintainers agree, then I would be happy to make a PR and implement frule and rrule via SVD instead of LU.
Questions:
- should the det evaluation then also use SVD, or should it use whichever the standard implementation is?
- should the SVD implementation be only for a specific class of matrices, or general? E.g. I'm unsure about sparse.
- I noticed that there are rules for
svd- I'm guessing this means one will be able to differentate thefruleorrrulebased on SVD?
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 reviewing the existing rules for det, inv, frule, rrule, and svd, then compare the LU and SVD approaches described in the issue. Before implementation, resolve whether det should use SVD, whether the rule should cover sparse matrices, and what numerical-stability guarantee is required; done means an agreed general design is implemented and its behavior is validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100