Reconstructing Cholesky variables from their indices gives wrong result in VNT
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
- 35/100
Direzione di ricerca
Inizia in src/varnamedtuple.jl alle righe 167-208 e segui come @vnt utilizza il template fornito quando ricostruisce i valori di Cholesky da MCMCChains.Chains. Confronta le due direzioni proposte —costruire incrementalmente un PartialCholesky oppure rimuovere il supporto per MCMCChains— e conferma che il VNT risultante preservi la struttura di Cholesky senza il workaround hasvalue/getvalue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
julia> using DynamicPPL, Distributions
julia> c = rand(LKJCholesky(3, 0.5))
Cholesky{Float64, Matrix{Float64}}
L factor:
3×3 LinearAlgebra.LowerTriangular{Float64, Matrix{Float64}}:
1.0 ⋅ ⋅
-0.71428 0.69986 ⋅
0.255189 0.911365 0.322942
julia> vnt = @vnt begin
@template c
c.L[1, 1] := c.L[1, 1]
c.L[2, 1] := c.L[2, 1]
c.L[2, 2] := c.L[2, 2]
c.L[3, 1] := c.L[3, 1]
c.L[3, 2] := c.L[3, 2]
c.L[3, 3] := c.L[3, 3]
end
VarNamedTuple
└─ c => VarNamedTuple
└─ L => PartialArray size=(3, 3) data::LinearAlgebra.LowerTriangular{Float64, Matrix{Float64}}
├─ (1, 1) => 1.0
├─ (2, 1) => -0.7142799536546864
├─ (3, 1) => 0.25518913641826435
├─ (2, 2) => 0.6998600915947837
├─ (3, 2) => 0.9113653464249535
└─ (3, 3) => 0.3229422703670502
Obviously, this doesn't reconstruct the Cholesky sample c despite us passing the template to it.
When does this pathological situation occur? Easy, it's when trying to load samples back into a VNT from MCMCChains.Chains, since Cholesky samples get broken up in MCMCChains.
(with FlexiChains it doesn't break up the sample so you would get something like this and it's a-ok
julia> vnt2 = @vnt begin
c := c
end
VarNamedTuple
└─ c => Cholesky{Float64, Matrix{Float64}}([1.0 5.0e-324 0.0; -0.7142799536546864 0.6998600915947837 0.0; 0.25518913641826435 0.9113653464249535 0.3229422703670502], 'L', 0)
)
Now the above issue doesn't yet cause problems because we have this patch for VNT that calls hasvalue(..., dist) and getvalue(..., dist)
However, it is really just wrong to even create a VNT with the wrong structure. That VNT should never be allowed to exist!!! We do have enough info to re-create the correct form of c because we pass the template in, it's just that we're not using it.
There are two Correct Things to do, either of which will allow us to stop creating these wrong VNTs, and thereby remove these hasvalue / getvalue methods:
- Use the template to make a PartialCholesky thing, and then fill it in one element by one element.
- Stop using MCMCChains, and once we stop using MCMCChains, just declare this as unsupported.
- 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à 1/5 Meno di un'ora Idoneità per principianti 90/100
SciML/OrdinaryDiffEq.jl#5175 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
SciML/ComponentArrays.jl#439 ·