Dynamic models with index notation
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- julia
- Ambito
- machine-learning
Direzione di ricerca
Inizia con gli esempi f_indices, f_product e f_addinf nell’issue, quindi esamina la discussione sulla semantica statistica e sui limiti del sampler. Il lavoro è completo quando si è deciso quale interpretazione del modello DynamicPPL debba supportare e come debba essere specificato il suo comportamento; non sono indicati file di implementazione né test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What is the statistical model that this should implement?
@model function f_indices()
b ~ Bernoulli()
x = Vector{Float64}(undef, b ? 1 : 2)
if b
x[1] ~ Normal(1.0)
else
x[1] ~ Normal(1.0)
x[2] ~ Normal(2.0)
end
end
Some options:
-
Nothing. That should be invalid.
-
A model for which the domain of x[2] is Union(Reals, {N/A}) and the joint is
p(b, x1, x2) = p(b) p(x1) p(x2 | b)
where
p(b) = Bernoulli
p(x1) = Normal(1.0)
and the distribution p(x2 | b) is such that its density function is
pdf(p(x2 | b == true))(y) = y == N/A ? 1.0 : 0.0
pdf(p(x2 | b == false))(y) = y == N/A ? 0.0 : pdf(Normal(2.0))(y)
- A model like the above but where the domain of x[2] is Reals and
pdf(p(x2 | b))(y) = b ? 1.0 : pdf(Normal(2.0))(y)
This is what we currently do. I'm not convinced that this is a valid statistical model though.
Other similar models
@model function f_product()
b ~ Bernoulli()
if b
dists = [Normal(1.0)]
else
dists = [Normal(1.0), Normal(2.0)]
end
x ~ product_distribution(dists)
end
This seems to currently implement option 2. from above.
@model function f_addinf()
b ~ Bernoulli()
x = Vector{Float64}(undef, b ? 1 : 2)
if b
x[1] ~ Normal(1.0)
else
if length(__varinfo__[@varname(x)]) == 1
@addlogprob! -Inf
end
x[1] ~ Normal(1.0)
x[2] ~ Normal(2.0)
end
end
This, too, seems to implement something like option 2. from above, in a different manner. f_product errors if you evaluate it with a VarInfo where b is false and x only has one element, whereas f_addinf executes but rejects all such samples.
Sampling
Note that we don't know how to sample from f_product or from f_addinf, or more generally anything that implements option 2. from above. The only samplers that I know of that can handle both discrete and continuous parameters are MH and Gibbs. Gibbs won't ever work for this, because if x is in the acceptable range for some value of b then you can't get a valid sample from changing just b or changing just the range of x; You'd have to change both at once, and that is exactly what Gibbs doesn't do. MH could in principle work, but we would need to use a proposal distribution that allows going from x being length 1 to x being length 2. Such a jump would then have to be done at the same time as changing the value of b.
- Lingua principale
- Julia
- Stelle
- 291
- Fork
- 43
- Merge medio
- 1g 23h
- PR unite (30g)
- 15
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TuringLang/DynamicPPL.jl
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 64/100
TuringLang/DynamicPPL.jl#1499 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
TuringLang/DynamicPPL.jl#1480 ·
I maintainer di solito rispondono entro 2 giorni
-
Separate model-evaluation inputs from outputsForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertadata-structures enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
TuringLang/DynamicPPL.jl#1469 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
TuringLang/DynamicPPL.jl#1466 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
documentation
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
TuringLang/DynamicPPL.jl#1390 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di TuringLang/DynamicPPL.jl
Issue simili
-
Release CorleoneInverse as 0.1.1Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
SciML/Corleone.jl#200 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
JuliaAI/MLJTransforms.jl#120 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
exercism/julia#1205 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
SciML/OrdinaryDiffEq.jl#5175 ·
I maintainer di solito rispondono entro 1 giorno