Skip to content

Commit

Permalink
Skip count update if there are no pattern to graph matches
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidharth Sundar committed Jun 15, 2022
1 parent 67245f0 commit f8feceb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions adam/learner/contrastive_learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,13 @@ def learn_from(self, matching: LanguagePerceptionSemanticContrast) -> None:
pattern_to_graph_matches = self._match_concept_pattern_to_multiple_graphs(
concept, graph
)
graph_matches = [
graph_match
for graph_match in pattern_to_graph_matches.values()
if graph_match is not None
]

if pattern_to_graph_matches:
graph_matches = [
graph_match
for graph_match in pattern_to_graph_matches.values()
if graph_match is not None
]
self._update_counts(concept, graph_matches, difference_nodes)
else:
logger.debug(
Expand Down

0 comments on commit f8feceb

Please sign in to comment.