The `copy` function used to average the models doesn't make a deep copy
When averaging the models, the copy()
function is called which does not seem to make a deep copy (clone) of the model. For example, if I enable the logging of consensus distance, I'm getting different results compared to when I don't log the consensus distance. This hints that the parameters of one of the models of the nodes has changed during averaging. The log_consensus_distance
method is calling average
.
It's hard to say what the consequences of this are, but when averaging the model, the original model should remain intact in any situation. There should be no references to objects included in the model that we copy from.
Using copied_model = copy.deepcopy(model)
seems to work correctly.