VNT docs: more things to elaborate on

Aperta
#1,209 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
julia
Ambito
documentation

Direzione di ricerca

Esamina la documentazione di VarNamedTuple aggiunta da #1204 e la issue #836 di DynamicPPL collegata prima di scegliere una sezione mirata. Usa come ambito gli argomenti rivolti agli utenti e agli sviluppatori che non sono contrassegnati, in particolare i cambiamenti nella forma degli array, le prestazioni, PrefixContext, i submodels e i casi limite noti. Il lavoro è completato quando vengono aggiunte spiegazioni ed esempi concreti per un sottoinsieme concordato di questi argomenti.

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

Descrizione

data-structures enhancement

#1204 adds a LOT of new docs on VarNamedTuple. There are still things I want to cover, but haven't. This issue is for me to list these things.

user-facing

  • Inflexibility to change shape/type of array once set. Impacts on DynamicPPL model specification. This is the main user-facing one.
  • Performance implications. What you can do to make your model faster. Concrete examples.
    • Since a shadow array is created for every x[i], you should only create an array x if you intend to use all (or at least most) of its elements on the LHS of tilde. Doing something like x = zeros(1000); x[1] ~ Normal() means that VarInfo will contain 999 useless masked elements. This encourages separation between "things I need for the function" and "things I need for the probabilistic model", which is good anyway.
    • Preserving type stability by using arrays with concrete eltypes.

dev

  • Conceptual similarities between handling VarInfo and AD / sparsity detection. Differences (AD can hook into every statement in the function, VarInfo can only hook into tilde-statements -- which leads to the above restriction on size-changing arrays).
    • Interesting that info about structs in the model are lost. They are just replaced with VNTs inside the VarInfo. Similar to Mooncake tangents, as I pointed out way back when.
  • Handling PrefixContext & submodels
  • Edge cases: where do things break down (see 'Known issues with VNT' issues I opened)
  • Edge cases we do handle and how we handle them: x[1:2][1] and x[1:2][2] is a good example
  • ArrayLikeBlocks. Markus wrote some stuff, but I want to add examples and code snippets.
  • Usage inside DynamicPPL: ValuesAsInModelAcc (stores plain values) vs. VarInfo (stores TransformedValue things). Differences in keys. See also https://github.com/TuringLang/DynamicPPL.jl/issues/836.
  • Probably more, I can't think right now because my brain is legitimately fried.
Lingua principale
Julia
Stelle
291
Fork
43
Merge medio
1g 23h
PR unite (30g)
15

Preparare l'ambiente

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 TuringLang/DynamicPPL.jl

Tutte le issue di TuringLang/DynamicPPL.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.