Ability to specify different rules based on what combinations of inputs are actually being used

オープン
#452 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
julia

調査の方向性

まず ChainRules API とリンク先の gist を確認し、次に提案された拡張を既存の ChainRulesCore の設計と比較します。PR #521 をめぐる議論を確認し、実験的な拡張パッケージでこの作業を扱うべきか判断します。入力の組み合わせごとに固有の微分規則について、API と実装計画が決定されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

design

It would be nice to have an extension to the ChainRules API that allowed for different rules to be written and hit depending on what combination of inputs the derivative is being taken with respect to.
(or maybe similar analogy for forwards mode)
Basically partial derivative rules.

Thunking is a simple approximation to this (with it's own set of struggles)

@wsmoses requested for Enzyme, though this is also relevant to every kind of operator overloading based AD (since only tracked types etc will have derivatives taken wrt to them).
In contrast it is useless for Zygote/Diffractor as they do no kind of activity analysis etc, and transform absolutely all code that is run.

A bit of a sketch for what that API might look-like is in https://gist.github.com/oxinabox/c6ad25c468b3108f8a799bda66c147f8/

This might also be useful for partial mutation support, since it is probably completely safe to have rules for things that mutate inputs that are not "active" on the derivative path? (cf https://github.com/JuliaDiff/ChainRules.jl/pull/521)
Though as the main reason we don't do mutation is tied to Diffractor/Zygote not supporting it, that might be kinda moot, unless they got some at least some basic activity analysis.

(NB: we may not initially implement this in ChainRulesCore. It might be better to make a little experimental extension package for it first.)

主要言語
Julia
スター
267
フォーク
66
平均マージ
1日 1時間
マージ済み PR(30日)
9

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaDiff/ChainRulesCore.jl のほかの issue

JuliaDiff/ChainRulesCore.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。