-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Thanks for the excellent work!
However, I have a question about the mean aggregation operation in Encoder: why divide by the length of the chunked sentence len(chunked_instances[index]) instead of the number that the sentence is chunked to?
The corresponding code is
# aggregate the embeddings
embeddings = np.zeros((len(sentences), self.hidden_size))
for i, index in enumerate(chunked_indices):
if aggregate_method == 'mean':
embeddings[index] += chunked_embeddings[i] / len(chunked_instances[index])
elif aggregate_method == 'sum':
embeddings[index] += chunked_embeddings[i]
elif aggregate_method == 'max':
embeddings[index] = np.maximum(embeddings[index], chunked_embeddings[i])
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels