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

Free energy computation of Transition is broken #410

Open
wouterwln opened this issue Jan 21, 2025 · 3 comments
Open

Free energy computation of Transition is broken #410

wouterwln opened this issue Jan 21, 2025 · 3 comments
Assignees

Comments

@wouterwln
Copy link
Member

In the following model, we have a simple transition node:

@model function transition_test(y)
    x ~ Categorical([0.1, 0.4, 0.5])
    y ~ Transition(x, diageye(3))
end

infer(model = transition_test(), data = (y =[0, 1, 0],), free_energy=true)

and free energy is being computed. However, when we assume a joint over the x and y:

@model function transition_test(y)
    x ~ Categorical([0.1, 0.4, 0.5])
    y ~ Transition(x, diageye(3))
end

infer(model = transition_test(), data = (y = UnfactorizedData([0, 1, 0]),), free_energy=true)

The inference procedure breaks and free energy is infinite. This is because the operation (https://github.com/ReactiveBayes/ReactiveMP.jl/blob/1d28b19d3b1c96ae42dc55dba12547bd94759995/src/nodes/predefined/transition.jl#L22) here is probably not numerically stable with zeroes. Nevertheless, it is a bug.

@wouterwln wouterwln self-assigned this Jan 21, 2025
@bvdmitri
Copy link
Member

The comment right above the link that you've shared mentions this exact issue? Doesn't it solve it?

@bvdmitri
Copy link
Member

Related issue from Magnus ReactiveBayes/ReactiveMP.jl#165 and PR ReactiveBayes/ReactiveMP.jl#169

@bvdmitri
Copy link
Member

Ah, I missed UnfactorizedData in this example, yeah, indeed a problem, should be fixed

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

2 participants