JuliaDiff / JuliaDiff/ChainRules.jl

Fixing and testing rules for functions with real and complex inputs

Open
#327 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

complex
Dominant language
Julia
Stars
475
Forks
98
PR merge metrics
No merged PRs in 30d

Description

There are quite a few rules where mixing complex and real inputs will result in the cotangent of a real input being complex. I proposed in JuliaDiff/ChainRulesCore.jl#176 that the right way to do things is actually to remove the imaginary part of the cotangent for real inputs. This is actually necessary in order to verify these rules with FiniteDifferences, so in general we do not actually test these mixtures.

If we choose to adopt this standard (I think we should), then we need to identify rrules that could take a mixture of real and complex inputs and ensure that the pullback projects if necessary, then add tests to that effect.

See also #232
cc @oxinabox

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the rrules that accept mixed real and complex inputs, then read JuliaDiff/ChainRulesCore.jl#176 and #232 for the proposed convention. Use FiniteDifferences to verify the affected rules; done means necessary pullbacks project cotangents for real inputs and tests cover these mixtures.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
machine-learning, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.