Skip to content
Snippets Groups Projects
Commit de939236 authored by Jérôme Botoko Ekila's avatar Jérôme Botoko Ekila
Browse files

fix: do not reverse list of certainties to choose smallest log likelihood

parent 0ff2062d
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ class AttentionSet:
for attn_id, certainties in self.certainties.items():
last_certainties[attn_id] = certainties[-1]
attns = []
for attn_id in sorted(last_certainties, key=last_certainties.get, reverse=True): # type: ignore
for attn_id in sorted(last_certainties, key=last_certainties.get): # type: ignore
attns.append((attn_id, self.set[attn_id]))
return attns
elif heuristic == "average":
......@@ -58,7 +58,7 @@ class AttentionSet:
for attn_id, certainties in self.certainties.items():
average_certainties[attn_id] = sum(certainties) / len(certainties)
attns = []
for attn_id in sorted(average_certainties, key=average_certainties.get, reverse=True): # type: ignore
for attn_id in sorted(average_certainties, key=average_certainties.get): # type: ignore
attns.append((attn_id, self.set[attn_id]))
return attns
elif heuristic == "discounted":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment