Filter padded samples from retrieval metrics#44
Filter padded samples from retrieval metrics#44ManasaDeshagouni wants to merge 1 commit intofacebookresearch:mainfrom
Conversation
Apply a batch-level mask before updating retrieval metrics so zero-padded samples are excluded from retrieval_top1.
|
Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary
This fixes a validation metrics inconsistency in
_run_step.When
stride_drop_incomplete=False, zero-padded rows are filtered for flattened metrics, but retrieval metrics were still updated using unfiltered batch tensors. As a result,retrieval_top1included padded boundary segments during default training runs.What changed
metric.update(...)Impact
This does not affect the Pearson metric used for checkpointing and early stopping. It fixes the logged retrieval metric so it reflects only valid samples.
Note
Previous W&B retrieval metrics may have been slightly inflated because zero-padded boundary segments were included.