Skip to content
Snippets Groups Projects
Commit a949bca4 authored by Yoann Schneider's avatar Yoann Schneider :tennis: Committed by Tristan Faine
Browse files

approved suggestion

parent c928cbbd
No related branches found
Tags 1.5.2-rc5
1 merge request!75Added function to aggregate attention maps
This commit is part of merge request !75. Comments created here will be created in the context of that merge request.
......@@ -44,8 +44,7 @@ def compute_coverage(text: str, max_value: float, offset: int, attentions):
# blank vector to accumulate weights for the current text
coverage_vector = np.zeros((height, width))
for i in range(len(text)):
local_weight = attentions[i + offset]
local_weight = cv2.resize(local_weight, (width, height))
local_weight = cv2.resize(attentions[i + offset], (width, height))
coverage_vector = np.clip(coverage_vector + local_weight, 0, 1)
# Normalize coverage vector
......
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