You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(There's demo_assume_matrix_dot_observe_matrix, but it doesn't test with indexing on the LHS of a tilde)
@modelfunctiondemo_assume_matrix_dot_observe_matrix(
x=transpose([1.52.0;]), ::Type{TV}=Array{Float64}
) where {TV}
n =length(x)
d = n ÷2
s ~reshape(product_distribution(fill(InverseGamma(2, 3), n)), d, 2)
s_vec =vec(s)
m ~MvNormal(zeros(n), Diagonal(s_vec))
# Dotted observe for `Matrix`.
x .~MvNormal(m, Diagonal(s_vec))
return (; s=s, m=m, x=x, logp=getlogp(__varinfo__))
end
Thanks, @penelopeysm; a quick thought: it might be helpful t to have separate sets of models in DynamicPPL.TestModels
for testing the DynamicPPL compiler
for testing inference algorithm correctness, e.g. models with analytical solutions or known solutions stored as constants
for testing autograd and log density performance, type stability, etc.
Each set of models can be retrieved by, e.g. DynamicPP.TestModels.models_for_compiler_tests / models_for_inference_correctness_tests, models_for_performance_autograd_tests.
See: #733 (comment)
When refactoring the demo models into a separate package, we should include one that has this as well.
The text was updated successfully, but these errors were encountered: