Skip to content

Simplify metric computations and test assertions in Metrax. - #169

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1023182283
Nov 20, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1023182283

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Simplify metric computations and test assertions in Metrax.

  • Combine duplicate rtol and atol tolerance definitions into atol = rtol = ... across base_test.py, classification_metrics_test.py, regression_metrics_test.py, and nnx_wrapper_test.py.
  • Remove redundant y_pred = y_pred.astype(y_true.dtype) casts in regression_metrics_test.py and nnx_wrapper_test.py.
  • Simplify binary threshold comparisons in Precision, Recall, and FBetaScore (classification_metrics.py).
  • Vectorize BLEU.compute and RougeBase.compute in nlp_metrics.py.
  • Delegate MAE, MSE, and MSLE from_model_output to super().from_model_output in regression_metrics.py.
  • base.Average.from_model_output now counts in int32 instead of the input dtype, fixing bfloat16/float16 count accumulation on long evaluations across Average-based metrics (SSIM, IoU, PSNR, CosineSimilarity, SNR, etc.).

@copybara-service
copybara-service Bot force-pushed the test_1023182283 branch 2 times, most recently from c55525f to 8d9cd8b Compare November 20, 2026 00:30
- Combine duplicate `rtol` and `atol` tolerance definitions into `atol = rtol = ...` across `base_test.py`, `classification_metrics_test.py`, `regression_metrics_test.py`, and `nnx_wrapper_test.py`.
- Remove redundant `y_pred = y_pred.astype(y_true.dtype)` casts in `regression_metrics_test.py` and `nnx_wrapper_test.py`.
- Simplify binary threshold comparisons in `Precision`, `Recall`, and `FBetaScore` (`classification_metrics.py`).
- Vectorize `BLEU.compute` and `RougeBase.compute` in `nlp_metrics.py`.
- Delegate `MAE`, `MSE`, and `MSLE` `from_model_output` to `super().from_model_output` in `regression_metrics.py`.
- `base.Average.from_model_output` now counts in `int32` instead of the input dtype, fixing bfloat16/float16 count accumulation on long evaluations across Average-based metrics (SSIM, IoU, PSNR, CosineSimilarity, SNR, etc.).

PiperOrigin-RevId: 1025997965
@copybara-service
copybara-service Bot merged commit 501a9f4 into main Nov 20, 2026
6 checks passed
@copybara-service
copybara-service Bot deleted the test_1023182283 branch November 20, 2026 00:35
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