GerryChainJulia
GerryChainJulia copied to clipboard
[WIP] Fix behavior of score_partition_from_proposal
We just discovered a ~~very serious~~ issue with how partitions are scored: eval_score_on_partition
and eval_score_on_districts
don't actually use new proposal information, so old scores are returned. (Update: this only affects certain use cases.)
Even though we have fixed the issue(s) with scoring partitions, one of the reasons why we only get constant scores in some chains is because of a different bug, which is caused by random_krusal_mst
being re-seeded with the same static seed (1234
) every time it is called. In some cases, when combined with other strange behavior that needs to be chased down, this results in a totally deterministic step function -- the chain never takes more than one step because every proposal is the same. This issue has been partially addressed in commit https://github.com/mggg/GerryChainJulia/pull/118/commits/49ce527992309b7225563386212c3d3e845f6eb9 and it appears that now the chain takes different steps each time!
Even though we have fixed the issue(s) with scoring partitions, one of the reasons why we only get constant scores in some chains is because of a different bug, which is caused by
random_krusal_mst
being re-seeded with the same static seed (1234
) every time it is called. In some cases, when combined with other strange behavior that needs to be chased down, this results in a totally deterministic step function -- the chain never takes more than one step because every proposal is the same. This issue has been partially addressed in commit 49ce527 and it appears that now the chain takes different steps each time!
I cherry-picked this fix to a different PR so we can have smaller PRs (at Parker's suggestion).