Open axch opened 8 years ago
On further investigation:
resample
One candidate explanation (at least for Lite): All the node collections used in scaffold construction are set
s. Not only that, but keyed by the object identities of the nodes, which are of course unstable from run to run.
How does this leak to sampling different values after inference? Not completely clear, but
regen
recursion) is unstable.(mh default one 1)
proposal is unstable, because they are chosen by a stable index into an unstable-order list.Why does Puma also exhibit instability? Not sure, but probably has a similar bug (perhaps in a less severe fashion, if the structures indexed by node identities are, e.g., binary search trees rather than hash tables).
Candidate solutions:
Indexing the scaffold structures by insertion order can be done by dropping in collections.OrderedDict
where we use dict
.
For the record: the uploaded program hardcodes a backend (Puma, I believe), but is a valid test program for either backend by editing that hardcode point.
For the record, confirmed (again?) that this issue does not affect Lite anymore.
@pgmoren gives us the enclosed test program, which is not deterministic (but should be). Specifically, the values reported by
global_log_joint
andglobal_log_likelihood
after the infer command vary (in both backends!). The ones before are stable. test_seed.py.txtUpdate: Lite is deterministic as of June 6 (PR #579)