Skip to content

Filter extra kwargs in NnxWrapper.update to support MultiMetric#144

Open
nikolasavic3 wants to merge 1 commit intogoogle:mainfrom
nikolasavic3:fix-nnx-wrapper-extra-kwargs
Open

Filter extra kwargs in NnxWrapper.update to support MultiMetric#144
nikolasavic3 wants to merge 1 commit intogoogle:mainfrom
nikolasavic3:fix-nnx-wrapper-extra-kwargs

Conversation

@nikolasavic3
Copy link
Contributor

Fixes #132
NnxWrapper.update now inspects the signature of the underlying metric's from_model_output and filters out kwargs it doesn't accept. This allows metrax.nnx metrics to work with nnx.MultiMetric, which passes all kwargs to every metric.

Changes:

  • metrax/nnx/nnx_wrapper.py: Filter kwargs based on from_model_output signature before forwarding
  • tests/nnx_wrapper_test.py: Add tests for extra kwargs handling and MultiMetric compatibility

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.

metrax.nnx metrics incompatible with nnx.MultiMetric due to strict kwargs in from_model_output

1 participant