Skip to content

Conversation

@mzganec
Copy link

@mzganec mzganec commented May 27, 2021

No description provided.

parallelizer = Parallel(n_jobs=self.n_jobs, max_nbytes=1e3, verbose=self.verbose)
task_iter = (delayed(parallel_dfmc_wrapper)(
R=R, M=M, Theta=T, obj_types=object_types,
R=R, M=M, Theta=T, obj_types=self.fusion_graph.object_types,
Copy link
Author

@mzganec mzganec May 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iteration order of obj_types in matrix initialization is not conserved if obj_types is a set. Consequently, matrix initialization is not always reproducible even if the same random_state is used, leading to irreproducibility of results.

Uniqueness of keys in self.fusion_graph.object_types is guaranteed already by its type, so conversion into a set is redundant.

np.testing.assert_almost_equal(fuser.complete(relation), trnf)
np.testing.assert_equal(fusion_graph.get_relation('R').data, R12)

def test_reproducibility(self):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this fix test_reproducibility occasionally fails depending on the iteration order of obj_types in matrix initialization. With the proposed fix this test always finishes successfully.

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