Skip to content
Discussion options

You must be logged in to vote

I took a look and I think I can get your example to work. I define this model:

@model function inference(x, m, p)
       z ~ Bernoulli(0.5)
       x ~ NormalMixture(switch = z, m = m, p = p)
end

Then if I try to run inference by calling

results = infer(
       model = inference(m = [0.0, 5.0], p = [1.0, 1.0]),
       data = (x = 1.0,)
)

I get "ERROR: The number of means and precisions in NormalMixture must be at least 2. Got 1 means and 1 precisions." If I change the brackets of m and p to round brackets, so that they are given as tuples:

results = infer(
       model = inference(m = (0.0, 5.0), p = (1.0, 1.0)),
       data = (x = 1.0,)
)

it works! We suspect the issue is that GraphPPL…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
4 replies
@ThijsJenneskens
Comment options

Answer selected by meditans
@bvdmitri
Comment options

@meditans
Comment options

@skoghoern
Comment options

Comment options

You must be logged in to vote
6 replies
@bvdmitri
Comment options

@meditans
Comment options

@meditans
Comment options

@bvdmitri
Comment options

@bvdmitri
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants