Skip to content

Conversation

@szymanowiczs
Copy link

According to Python documentation, 'sets do not record element position or order of insertion' and the ordering of the elements is not deterministic, i.e. might change with the random seed or other seemingly irrelevant operations (in my case it changed with changing the test batch size). If the order of branches changes, attempting to load a model will result in layer name mismatch, and hence the layers being incorrectly populated with random weights, preventing the reproducibility of results in testing. Changing the type of branch_names to tuple ensures the object is still immutable and has deterministic behaviour.

According to Python documentation, 'sets do not record element position or order of insertion' and the ordering of the elements is not deterministic, i.e. might change with the random seed or other seemingly irrelevant operations (in my case it changed with changing the test batch size). If the order of branches changes, attempting to load a model will result in layer name mismatch, and hence the layers being incorrectly populated with random weights, preventing the reproducibility of results in testing. Changing the type of branch_names to tuple ensures the object is still immutable and has deterministic behaviour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant