Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Test Linearity

Aperta
#120 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
julia
Ambito
testing-qa

Direzione di ricerca

Non viene indicato alcun percorso di file o di test. Inizia leggendo le utility di test esistenti per rand_tangent, rrule e frule, quindi determina come verificare la linearità di pushforward e pullback. Il lavoro è completo quando vengono aggiunti test concordati per il comportamento con zero e scalari, includendo l'additività solo se la generazione di differenziali disponibile la supporta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Pushforwards and pullbacks are requred to be linear operators.
Which formally is defined as φ(𝛼x) = 𝛼φ(x) and φ(a+b) = φ(a) + φ(b) for a,b,x differentials/vector space elements, and 𝛼 being a scalar.

A important collory of that is φ(0) = 0 where two 0s are the additive identity for the relivent vector spaces.
Which we can test with iszero(φ(zero(d)), since we always have access to a differential d, and all differentials must define zero and iszero.

Similarly we can test φ(𝛼x) = 𝛼φ(x) via φ(2d) == 2φ(d) since all differnetial define multiplication with a scalar. and we have one provided d.

We can't easily test φ(a+b) = φ(a) + φ(b) though, as we only have one differential.
We can test φ(d+d) = φ(d) + φ(d) but that is less interesting.
If we are generating them using rand_tangent we can easily generate another.
Though perhaps we should be insisting that things define the addition of there natural differentials with the structural differentials that rand_tangent will most often provide (though sometimes rand_tangent's structural differential will have extra nondifferentiable fields so we can't trust it, unless we insist the user does actually overload it).
Or we could avoid direct additon and do (primal + rand_tangent(d)) + d) though this is getting off-topic..
Possibly just skip that in initial implementation of this

The linear pullback can be extracted from the rrule via (f,primal...) -> (ds...) -> last(rrule(f, primal...))(ds...) (or equiv: (f,primal) -> last(rrule(f, primal))) The linear pushforward can be extracted from frulevia(f,primal) -> (ds...) -> frule(ds..., f, primal...)`

Lingua principale
Julia
Stelle
50
Fork
18
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di JuliaDiff/ChainRulesTestUtils.jl

Tutte le issue di JuliaDiff/ChainRulesTestUtils.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.