Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve reproducibility of results in Dfmc and Dfmf #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mzganec
Copy link

@mzganec mzganec commented May 27, 2021

No description provided.

@@ -95,7 +94,7 @@ def fuse(self, fusion_graph):

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.

@@ -84,6 +84,19 @@ def postprocessor(data):
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