Skip to content

Exclude padded time steps from WAPE evaluation - #2

Open
sushan5140 wants to merge 1 commit into
seqml:mainfrom
sushan5140:fix/wape-padding-mask
Open

sushan5140 wants to merge 1 commit into
seqml:mainfrom
sushan5140:fix/wape-padding-mask

Conversation

@sushan5140

Copy link
Copy Markdown

Problem

ConTSG passes each sample's valid sequence length to the metric runner in both fresh and cached evaluations. WAPE currently sums over the padded tensor. For a reference of [2, 0], a prediction of [2, 99], and ts_len=[1], the score is 4,950% on the current code and 0% with this patch.

Change

Select positions where the time index is below ts_len before computing absolute errors and reference magnitudes. Both WAPE sums use the same valid positions, including when padding contains NaN or infinity. Batches without lengths use the full time axis. A zero valid denominator still yields NaN.

Validation

  • Archived reproduction went from 2 passing and 3 failing to 5 passing.
  • python -m pytest tests/eval/test_wape.py -q -o addopts= went from 4 passing and 7 failing to 11 passing. This includes fresh evaluation and cache-only replay through the real evaluator and metric runner, with a deterministic CPU model fixture and Euclidean distance as a control.
  • The 16 existing tests had the same outcome on both versions. Fifteen passed and one failed because its error-message regex expects POSIX path separators on Windows.
  • Python compilation, focused Ruff checks, and git diff --check passed.

Validation used synthetic CPU inputs. Benchmark datasets, trained checkpoints, and published scores were outside this validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant