Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initializing message towards node with SVMP with multiple clusters breaks inference procedure #344

Open
wouterwln opened this issue Aug 14, 2024 · 0 comments

Comments

@wouterwln
Copy link
Member

This only works when we have 4 or more interfaces, since we need SVMP with 3 or more clusters. For example, in the GCV node, we have $q(x, y)q(w)q(k)q(z)$ as factorization constraint. Let's define the following model:

@model function demo(ay)
    x ~ NormalMeanVariance(0.0, 1.0)
    z ~ NormalMeanVariance(0.0, 1.0)
    k ~ NormalMeanVariance(0.0, 1.0)
    w ~ NormalMeanVariance(0.0, 1.0)
    y ~ GCV(x, z, k, w) 
    ay ~ NormalMeanVariance(y, 1.0)
end
c = @constraints begin
    q(x,y,z,k,w) = q(x, y)q(k)q(z)q(w)
end

Now in order to run inference in this model, we need to initialize the marginals on k, z and w, otherwise we cannot compute the messages towards x and y. This checks out:

i = @initialization begin
    q(k) = NormalMeanVariance(0.0, 1.0)
    q(w) = NormalMeanVariance(0.0, 1.0)
    q(z) = NormalMeanVariance(0.0, 1.0)
end

However, if we now initialize a message on y, the inference procedure breaks:

i = @initialization begin
    q(k) = NormalMeanVariance(0.0, 1.0)
    q(w) = NormalMeanVariance(0.0, 1.0)
    q(z) = NormalMeanVariance(0.0, 1.0)
    μ(y) = NormalMeanVariance(0.0, 1.0)
end
Variables [ w, k, z, x ] have not been updated after an update event. 
Therefore, make sure to initialize all required marginals and messages. See `initialization` keyword argument for the inference function. 
See the official documentation for detailed information regarding the initialization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant