ReactiveMP.jl icon indicating copy to clipboard operation
ReactiveMP.jl copied to clipboard

`@rule .... (m_out :: PointMass,)` and `@rule .... (q_out :: PointMass,)` are identical but should both be defined

Open wouterwln opened this issue 1 year ago • 1 comments

When defining rules around a node where a PointMass distribution comes in, we default to @rule .... (q_out :: PointMass,) even if the prior is conjugate. Therefore when defining a new node, even when we use message passing, as user will probably first define @rule .... (q_out :: PointMass,) and then get an error message saying that @rule .... (q_out :: PointMass,) is not defined, even though these rules are identical.

wouterwln avatar Apr 24 '23 09:04 wouterwln

We might have had already opened an issue about that before. It is true that the implementation is suboptimal and requires both rule to be defined, even though they are indeed identical. The idea was that the rules where all arguments are of type PointMass could be pre-regenerated in the @node macro. But we decided not to approach it and perhaps instead rework the @rule macro and message update rules such that it is no longer needed. For now the workaround is to define both rules.

bvdmitri avatar Apr 24 '23 11:04 bvdmitri