>>> from sppl.distributions import rv_discrete
>>> from sppl.spe import DiscreteLeaf
>>> d1 = rv_discrete(values=((1, 2), (.5, .5)))
>>> d2 = rv_discrete(values=((1, 2), (.8, .2)))
>>> l1 = Id("X") >> a
>>> l2 = Id("X") >> b
>>> l1 == l2
True
The problem is that scipy does not store the values under the kwds in the frozen rv_discrete object, that is
>>> l1.dist.kwds
{}
>>> l2.dist.kwds
{}
and so the equality logic checking passes:
https://github.com/probcomp/sppl/blob/efff34fb3d3703247dd7001c36970069c5ac3825/src/spe.py#L828-L836
The kwds field is populated by scipy for all other distributions norm, poisson, etc.
The problem is that scipy does not store the
valuesunder thekwdsin the frozen rv_discrete object, that isand so the equality logic checking passes:
https://github.com/probcomp/sppl/blob/efff34fb3d3703247dd7001c36970069c5ac3825/src/spe.py#L828-L836
The
kwdsfield is populated by scipy for all other distributionsnorm,poisson, etc.