Repository navigation
fix(normalize): correct UtteranceMVN variance normalization - #3853
Merged
Merged
Conversation
LauraGPT
added a commit
that referenced
this pull request
Nov 7, 2026
Preserve the original PR #3853 commit. Synchronize retained main content to the exact tested integration tree without rewriting history. Use IEEE FP32 only inside audio integration tests, restore backend settings, and keep all assertions and tolerances unchanged. Add the regression file to the existing NumPy matrix. Signed-off-by: LauraGPT <zhifu.gzf@alibaba-inc.com>
LauraGPT
added a commit
that referenced
this pull request
Nov 7, 2026
Preserve the original contributor commit and add maintained regression coverage. No administrator bypass. Signed-off-by: LauraGPT <zhifu.gzf@alibaba-inc.com>
Merged
LauraGPT
added a commit
that referenced
this pull request
Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With both mean and variance normalization enabled,
UtteranceMVNincludes mean-shifted padding in its variance and divides bystd.sqrt()instead ofstd. The same recording therefore produces different valid features depending on batch padding, and its normalized variance is not generally one.Mask padding after centering and divide by the standard deviation once.
Type of change
Validation
New regressions: 20 failed, 35 passed on
efe5504e; 55 passed with the fix. Including adjacent frontend tests on the candidate integrated withefe5504e: 97 passed on CPU/CUDA (RTX 5080, PyTorch 2.10.0+cu128).Real repository audio through a randomly initialized Transformer: single-vs-mixed-batch feature differences drop from 2.44 to 7.15e-7, and variance returns to approximately 1.
python -m compileall funasr examples testsDocs or links checked
Runtime/deployment command tested
User impact
Recordings using mean-and-variance normalization now produce consistent valid features across batch lengths. The affected branch requires both options enabled;
norm_varsdefaults to false.Notes for reviewers
Checkpoints trained with both options enabled will receive different normalized features after this fix and should be reevaluated for recognition quality.
Related padding fix: ESPnet #6571.