You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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])
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: