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

Relax rules for structured VMP in Transition node #418

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

wouterwln
Copy link
Member

With UnfactorizedData, we should be able to send PointMass messages with a factorized a as well. The rules are the same as for a Categorical (as far as I can see) but we didn't dispatch on them yet.

@ThijsvdLaar
Copy link

Does this change rely on an implementation of BayesBase.probvec(::PointMass)? Since the point mass rules are only supposed to work with one-hot encoded vectors, how is this handled?

@bvdmitri
Copy link
Member

bvdmitri commented Oct 3, 2024

I think the current probvec simply returns the underlying vector without checking if its one hot encoded or not:

julia> using BayesBase

julia> probvec(PointMass(1))
ERROR: probvec(::PointMass{ <: Real }) is not defined
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] probvec(::PointMass{Int64})
   @ BayesBase ~/.julia/dev/BayesBase/src/densities/pointmass.jl:68
 [3] top-level scope
   @ REPL[2]:1

julia> probvec(PointMass([1, 2]))
2-element Vector{Int64}:
 1
 2

@ThijsvdLaar
Copy link

Ok, seems reasonable to not check for one-hot encoding, maybe make a note of this for clarity.

@wouterwln wouterwln merged commit 99a00a6 into main Oct 3, 2024
6 checks passed
@wouterwln wouterwln deleted the transition-rules branch October 3, 2024 08:56
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

Successfully merging this pull request may close these issues.

3 participants