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
@model function My_model(y)
A ~ NormalMeanVariance(2.0,1.0)
B ~ NormalMeanVariance(1.0,1.0)
y ~ MyNode(A,B)
end
result = infer(
model = My_model(),
predictvars = (y = KeepLast(), ),
)
But when I predict the y using:
result.predictions[:y]
it gives "missing". As an alternative, I also tried
result = infer(
model = My_model(),
data = (y = missing , ),
)
The result is the same.
The text was updated successfully, but these errors were encountered:
I will repeat my message from Slack for better observability, we may fix it in the future, here is a workaround
julia> result =infer(
model =My_model(),
data = (y =UnfactorizedData(missing), ),
)
Inference results:
Posteriors | available for (A, B)
Predictions | available for (y)
julia> result.predictions
Dict{Symbol, NormalMeanVariance{Float64}} with 1 entry::y=>NormalMeanVariance{Float64}(μ=3.0, v=2.0)
This is an unfortunate detail of the implementation. Basically due to the fact that y is treated as data entry automatic constraints makes structured factorization for your model, which means that your written BP rules are never called. Instead RxInfer attempts to compute joint marginal over A and B , but since data is missing there is no information to compute it, so the inference engine happily returns you missing as a result.
Not great at all, but `UnfactorizedData was an attempt to override the default behavior and force BP rules. Its referenced here and was a way to fix broken example where predictions were completely off due to similar issue
I made a custom node and want to check the forwarded message out of that by using it in a model. This is the implementation:
But when I predict the y using:
result.predictions[:y]
it gives "missing". As an alternative, I also tried
The result is the same.
The text was updated successfully, but these errors were encountered: