From c38ede86196441926e61fcdef84eff47a1ace5d0 Mon Sep 17 00:00:00 2001 From: Sidharth Sundar Date: Tue, 14 Jun 2022 12:20:40 -0400 Subject: [PATCH] Add back issue #1140 --- adam/learner/contrastive_learner.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adam/learner/contrastive_learner.py b/adam/learner/contrastive_learner.py index b51947b57..258c2fa72 100644 --- a/adam/learner/contrastive_learner.py +++ b/adam/learner/contrastive_learner.py @@ -193,6 +193,12 @@ def learn_from(self, matching: LanguagePerceptionSemanticContrast) -> None: def _match_concept_pattern_to_multiple_graphs( self, concept: Concept, graph: PerceptionGraph ) -> Mapping[PerceptionGraphTemplate, Optional[PerceptionGraphPatternMatch]]: + # Arbitrarily take the first match per hypothesis. + # + # Because there may be more than one match per hypothesis, this results in non-deterministic behavior in + # general. We would like to do something smarter. See the GitHub issue: + # https://github.com/isi-vista/adam/issues/1140 + # TODO issue return { apprentice_concept: apprentice_concept.graph_pattern.matcher( graph,