class DenseFeaturizer2(Featurizer2[np.ndarray], ABC)
Base class for all dense featurizers.
def aggregate_sequence_features(dense_sequence_features: np.ndarray, pooling_operation: Text, only_non_zero_vectors: bool = True) -> np.ndarray
Aggregates the non-zero vectors of a dense sequence feature matrix.
dense_sequence_features- a 2-dimensional matrix where the first dimension is the sequence dimension over which we want to aggregate of shape [seq_len, feat_dim]
pooling_operation- either max pooling or average pooling
only_non_zero_vectors- determines whether the aggregation is done over non-zero vectors only
a matrix of shape [1, feat_dim]