Skip to content

Fix Perplexity metric accumulation across tokens and sample weights in Metrax. - #159

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_981915206
Sep 15, 2026
Merged

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

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Fix Perplexity metric accumulation across tokens and sample weights in Metrax.

Previously, Perplexity.from_model_output normalized cross-entropy per batch and weighted each batch by sequence count (labels.shape[0]) rather than total token count/weight. A recent KerasHub update (cl/974631537) changed the Perplexity metric calculation logic to normalize by total token count, which led to failing tests in Metrax.

I have also fixed couple of legacy lint errors, because they were blocking presubmit.

Updating the ci.yaml to use the keras-hub-nightly for testing in CI environment.

@google-cla

google-cla Bot commented Sep 15, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service
copybara-service Bot force-pushed the test_981915206 branch 5 times, most recently from 3615d25 to cb456f9 Compare September 15, 2026 22:53
…n Metrax.

Previously, `Perplexity.from_model_output` normalized cross-entropy per batch and weighted each batch by sequence count (`labels.shape[0]`) rather than total token count/weight. A recent KerasHub update (cl/974631537) changed the Perplexity metric calculation logic to normalize by total token count, which led to failing tests in Metrax.

I have also fixed couple of legacy lint errors, because they were blocking presubmit.

Updating the ci.yaml to use the keras-hub-nightly for testing in CI environment.

PiperOrigin-RevId: 982091649
@copybara-service
copybara-service Bot merged commit 2ab9c95 into main Sep 15, 2026
5 of 6 checks passed
@copybara-service
copybara-service Bot deleted the test_981915206 branch September 15, 2026 22:57
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.

0 participants