Masked mean pooling : which locations are averaged per vector
The average pool grouping of multiple token or event vectors is expressed as a fixed dimension.
Learning objectives and first steps2 objectives 2 first fixes
Try to do it after reading
- Construct a sentence or sequence in a valid position
- Handle empty sequences and sample weights
Suggested first
- Inner vectors & Parameters
- Classified loss and gradient
Define participant before average
The average pool grouping of multiple token or event vectors is expressed as a fixed dimension. If the input is completed, you must return to the valid location mask. The number of fixes is zero for the solution molecules, and the number of valid denominators is still checked. Otherwise, the same sequence may receive vectors of different lengths in different batches.
The effective vector shall be [2,0] and [0,4], to be completed in two rows [0,0]. In line 4, mean gets [0.5,1] and in two active positions [1.2]. If L2 were to be normalized later, certain purely scaling differences would be eliminated, but errors could not be ignored: bias, non-linearity, zero situation and other integration features could continue to be affected.
The shape is usually H = [Batch, Time, Dimension], mask = [Batch, Time]. (b) The molecules are to be calculated using the last broadcastable shape of mask; The denominator retains the batch axes and sets them in time. If mask is mistakenly collected along the feature axis, certain dimensions are not wrongly stated when they are exactly the same, but semantics have changed.
There's a clear return rule for empty sequences
There is no normal average when the valid quantity is 0. Inputs may be refused, a dedicated empty expression may be returned or a pre-deprived vector may be used, provided that it is consistent with the training agreement. The use of epsilon to avoid NaN alone will yield a limited value, but it does not indicate what it represents. The service end should record the empty sequence ratio and check the upstream failure.
Not all token are necessarily involved in the mean value. The exclusion of a special stopout, command prefix and template text depends on the model training approach. The deletion of a special symbol without verification could undermine pre-training indications and the retention of all would allow the long template to dominate short content. Specific strategies should be retained and a fixed example should be provided.
The sentence indicates that it is also influenced by the encoder output layer selection. The final layer, several layers, and projector output vary in price. The comparison pool scheme should be subject to other conditions and should not be attributed to mean itself after the different models and differences are normalized and changed simultaneously.
This section refers to an open interface between Sentence-BERT and the pool, all vectors being synthetic teaching data. The scope of application is an encoder that supports the corresponding hidden state and mask, and does not claim to be the best average pool for all models.
Is mask always correct after padding clear 0, direct mean?
Not always correct, the denominator may still contain padding, which should be counted as a valid quantity.
All mask input epsilon for 0 vectors. Have you defined the semantics?
No, only errors in values are avoided and empty input operations or text implications still need to be clearly designed.
Sources and reconciliations
Definitions, methods and interfaces are available.
Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.