JuliaDiff / JuliaDiff/ChainRulesCore.jl
Efficient complex differentiation by structured 2x2 matrices
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 267
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Description
For efficient complex differentiation, we need to express the following structured matrices:
holomorphic:
[a -b]
[b a]
anti-holomorphic:
[a b]
[b -a]
C->R:
[a b]
[0 0]
R->C:
[0 0]
[a b]
general:
[a c]
[b d]
Wirtinger derivative archives this by doing a basis transformation from x, y to z, z̄. However, that would introduce more FLOPs, since you need to transform them to x, y when multiplying a complex number. I.e. (x = z+z̄) and (y = i(z - z̄))
IMO, structured matrices are far more transparent than Wirtinger derivative, and they don't require a change of basis before multiplying with a complex number.
To implement structured matrices, we could do
struct Holomorphic{T,S}
a::T
b::S
end
Base.:*(::Holomorphic, ::Complex) = ...
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 proposed Holomorphic type and the Base.:* dispatch with Complex values, then compare the listed holomorphic, anti-holomorphic, C->R, R->C, and general matrix forms. The issue does not name files or tests; done requires an agreed structured-matrix design and coverage for the listed forms without the proposed basis transformation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100