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

approved suggestion

parent 23f5346b
No related branches found
No related tags found
1 merge request!75Added function to aggregate attention maps
......@@ -39,8 +39,7 @@ def compute_coverage(text: str, max_value: float, offset: int, attentions):
:param offset: Offset value to get the relevant part of text piece
:param attentions: Attention weights of size (n_char, feature_height, feature_width)
"""
height = attentions.shape[1]
width = attentions.shape[2]
_, height, width = attentions.shape
# blank vector to accumulate weights for the current text
coverage_vector = np.zeros((height, width))
......
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