Closed bartvanerp closed 9 months ago
This task has been added to the milestone for tracking and prioritization.
To solve this you simply need to add
Base.broadcastable(pm::PointMass) = Ref(pm)
@Chengfeng-Jia This task has been added to the milestone for tracking and prioritization.
I tried running the following code,
inference(
model = model(nr_samples),
initmarginals = (z= PointMass(1.0), ),
data = (y = y, ),
)
No error reported, should it have been fixed? Is there a mistake in my understanding
@Chengfeng-Jia was z
an array of random variables in your model? In this case the issue seems to have fixed itself.
I misunderstood before, now I changed z
to an array of random variables. Indeed, this code doesn't work.
initmarginals = (z= PointMass(0),)
However, if I change the code like this, it runs well and doesn't need to repeat
initmarginals = (z= [PointMass(0)],)
Do you think it's fine, or still need the broadcast part
I would prefer initmarginals = (z= PointMass(0),)
to work, similarly as we can do initmarginals = (z= Normal(0,1),)
Uh, I see.
However, if I change the code like this, it runs well and doesn't need to repeat initmarginals = (z= [PointMass(0)],)
It's a "bug", it silently initializes only one (the first) variable
Will be closed by https://github.com/biaslab/ReactiveMP.jl/pull/360
It is possible to start of the inference procedure like
which initializes all variables
z
with theNormalMeanVariance(0,1)
distribution. However, it throws an iteration error forPointMass
objects, which need to be explicitly repeated as