JuliaDiff / JuliaDiff/ChainRules.jl

Non-associative number types

Open
#594 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-careful-thought
Dominant language
Julia
Stars
475
Forks
98
PR merge metrics
No merged PRs in 30d

Description

I was recently reminded that some number types are not even associative under multiplication, e.g. Quaternions.Octonion. So fixes like #504, #540, which would support numbers that don't commute under multiplication, like quaternions, would still do the wrong thing for octonions. On the other hand, there are number types like Unitful.Quantity, which are Numbers, for which we want our rules to work.

So I see 2 ways forward:

  1. Implement only rules that make no additional assumptions about the properties of the numbers beyond the primal, and only in cases where the primal is define in base.
  2. Try to implement rules generically, but assume that numbers that violate basic properties like associativity are rare and require (and document) that devs of packages with such numbers need to opt out of these rules for compatibility with ChainRules-compatible ADs.

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 comparing the two proposed approaches in this issue and reviewing #504 and #540; no files or tests are named. The work is done when maintainers choose and document a compatibility strategy for non-associative number types while preserving support for Unitful.Quantity.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.