Closed wmkouw closed 11 months ago
@wmkouw Yeah, we should clarify that in the documentation, but that is the known limitation and it is not related to the biaslab/ReactiveMP.jl#9. Linearization
approximation implementation both in ReactiveMP
& ForneyLab
requires all inputs to be of the Gaussian
type.
Intermediate expressions will not help in general, as it would work only with constvar
s, but not with datavar
s.
I think I have discussed this issue with someone (Tim?). The consensus was that we would like to support (IMO its perfectly valid to specify this) this case. But short story long its not straightforward nor trivial to implement and will require some time.
The main problem here is that we need to compute a joint marginal over input arguments and its not entirely clear for me what is the joint marginal over inputs in case if one of the variables is clamped. +
node for example has it as a special case and implements hard-coded rules. So we need to, again, treat it as a special case and dynamically discard some edges from the resulting marginal. That would lead to the change in the Bethe Free Energy computation logic as well.
That is good that you've opened the issue, such that I do not forget about that, but for now you'll have to soften the input a
(or fuse it into the function outside of the @model
macro).
Ah, ok. Then I'll remove the bug
label and close the issue.
I would like to keep the issue itself if you don't mind :) Such that we don't forget and discuss during our next RxInfer meeting
The delta node with
Linearization
meta does not allow me to define a function with both a RandomVariable and DataVariable argument.MWE (adapted from Nonlinear Virus Spread demo):
returns:
The closest candidate does seem to allow subtypes of
AbstractVariable
as inputs. In fact, the function call indicates::Tuple{RandomVariable, DataVariable{PointMass{Float64} ..
and the candidate allows::Tuple{Vararg{var"#s2203", N}} where var"#s2203"<:AbstractVariable
. So that should match. I don't really understand why it throws the error.Related to https://github.com/biaslab/RxInfer.jl/issues/9? Also, documentation as suggested by Albert here https://github.com/biaslab/RxInfer.jl/issues/46 would be useful.
A related question: should we allow GraphPPL to generate intermediate expressions such as
gg(x) = g(x, a)
and apply the delta node to those? Or is creating expressions dynamically too inefficient?Versions: