Replies: 3 comments 1 reply
-
|
Here's a general function I like: as you see from my rule above, I would like the total contribution to the prior to be uniform_categorical(n) = Categorical(fill(1/n, n))
@rule Categorical(:p, Marginalisation) (m_out::Categorical, meta::EntropyWeighted,) = begin
vec_out = probvec(m_out)
dim_out = length(vec_out)
w = 1 - entropy(m_out) / entropy(uniform_categorical(dim_out))
return Dirichlet(1 .+ w .* vec_out)
endThese are not the messages prescribed by the Bethe Free Energy minimization framework, but I wonder if they can work as an approximation in the same way a meanfield constraint around this node would. I would be interested in understanding if adding this sort of rules can introduce problems I didn't anticipate, and if it could be justified theoretically. |
Beta Was this translation helpful? Give feedback.
-
|
I'm posting this as part of a conversation with @meditans as we discussed this at RxInfer meetings: """ To which @meditans replied, and requested I post the discussion here to avoid context loss: |
Beta Was this translation helpful? Give feedback.
-
|
Thank you both @skoghoern and @apashea. Here's the model @skoghoern is suggesting: @model function model_00(y)
p ~ Dirichlet([1.0, 1.0])
local content, obs_open_lid, lid_status
for i in eachindex(y)
content[i] ~ Categorical(p)
obs_open_lid[i] ~ DiscreteTransition(content[i], [1.0 0; 0 1; 0 0])
obs_open_lid[i] ~ Categorical([0.5, 0.5, 0])
lid_status[i] ~ Categorical([0.5, 0.5])
y[i] ~ Mixture(switch = lid_status[i],
inputs = [obs_open_lid[i], [0.0, 0.0, 1.0]])
end
end
yep = [1.0, 0, 0]
nope = [0.0, 1, 0]
lid = [0.0, 0, 1]
result = infer(
model = model_00(),
data = (y = [lid, lid, lid],),
addons = (AddonLogScale(),)
)and this is the one I was gesturing at in our discussion @apashea: @model function model_01(y)
p ~ Dirichlet([1.0, 1.0])
local lid_status
for i in eachindex(y)
state_informative[i] ~ Categorical(p)
state_uninformative[i] ~ Categorical([0.5, 0.5])
lid_status[i] ~ Categorical([0.5, 0.5])
y[i] ~ Mixture(switch = lid_status[i],
inputs = [state_informative[i], state_uninformative[i]])
end
end
result = infer(
model = model_00(),
data = (y = [lid, lid, lid],),
addons = (AddonLogScale(),)
)In both models, that are probably the same underlying idea, I don't know how to solve the errors that arise from the missing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm running into a curious modeling problem in which a posterior becomes more and more certain in presence of uninformative observations, and I wanted to open a discussion to know how you guys would solve it.
As in all my latest examples, I have in front of me a series of boxes. They can have one of two items inside, and can have a lid or not. I observe either the content inside or the lid (3 possible observations). I start thinking that the boxes have a shared prior of
Dirichlet([1, 1])(I know that the boxes are all the same in distribution). Then I observe 100 closed lids. Then the posterior on the boxes will beDirichlet[51, 51]! I have become more certain that the boxes are uniformly distributed even when I couldn't see anything!!!The code:
I understand now that this is a side effect of me using the
q(p, a) = q(p)q(a)constraint. I determined that in this particular case, since the messages that can arrive are one of:I am justified in writing the rule:
This, plus dropping the now useless meanfield assumption, will update the prior sensibly in my case. But what is a sensible general choice for this rule, that can accept all values for the categorical distribution and not only the three values I have here?
Beta Was this translation helpful? Give feedback.
All reactions