`pointwise_logdensities`, `returned`, `logjoint`, etc. APIs are weird

Aperta
#1,332 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@ArpanC6 ci sta già lavorando.

Dal 2/5/2026.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
julia

Direzione di ricerca

Inizia tracciando le API esistenti pointwise_logdensities, returned e logjoint e le relative chiamate a evaluate!!(model, varinfo). Confronta gli overload esistenti di logjoint e returned, quindi determina come un metodo interno condiviso possa accettare AbstractInitStrategy mantenendo la compatibilità con VarInfo. Il lavoro è completo quando le API condividono l’implementazione prevista, supportano gli overload di InitFromParams e mantengono un comportamento equivalente.

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

Descrizione

good first issue interface-design

Fundamentally all of these functions take some input, run the model, collect some accumulator's output (or the return value), and then give that back to the user.

Traditionally these have all taken a VarInfo argument. That's because they all used to call evaluate!!(model, varinfo). This makes little sense nowadays. It should take an AbstractInitStrategy argument, with some common overloads for parameter types that wrap them in InitFromParams before calling the main function. For example, logjoint(model, ...) already follows this pattern, along with returned; so the point would be to unify all of these things into a single internal method, and have logjoint, ... etc defined in terms of that method.

I think there's a reasonable amount of code duplication that could be reduced in this too. Because at the end of the day really all you're saying is: this is my model, these are my params, I want these accumulators, I want to evaluate the model and return this thing.

We could even keep the VarInfo methods; they just need to dispatch to InitFromParams(vi.values).

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.