Skip to content

Minor improvements and cleanup using tree utility functions.#1365

Merged
copybara-service[bot] merged 1 commit intogoogle-deepmind:mainfrom
carlosgmartin:minor_improvements_using_tree_utils
Mar 24, 2026
Merged

Minor improvements and cleanup using tree utility functions.#1365
copybara-service[bot] merged 1 commit intogoogle-deepmind:mainfrom
carlosgmartin:minor_improvements_using_tree_utils

Conversation

@carlosgmartin
Copy link
Copy Markdown
Contributor

@carlosgmartin carlosgmartin commented Jun 27, 2025

Edits code to use already-existent tree utility functions, where possible.

@carlosgmartin carlosgmartin force-pushed the minor_improvements_using_tree_utils branch from de7cdd1 to f65f87c Compare June 27, 2025 02:35
@carlosgmartin carlosgmartin changed the title Apply minor improvements using tree utility functions. Deprecate optax.global_norm in favor of optax.tree.norm. Minor improvements and cleanup Jun 27, 2025
@carlosgmartin carlosgmartin force-pushed the minor_improvements_using_tree_utils branch from f65f87c to b1d4b63 Compare June 27, 2025 03:00
@vroulet
Copy link
Copy Markdown
Collaborator

vroulet commented Jun 27, 2025

Make it three PRs :)
For optax.global_norm vs optax.tree.norm, just to be extra-sure (since that optax.global_norm is used a lot), can you make sure that their hlos match?
For tree.norm, keep the same signature as jnp.linalg.norm (that's what users will probably expect.)

@carlosgmartin
Copy link
Copy Markdown
Contributor Author

@carlosgmartin carlosgmartin changed the title Minor improvements and cleanup Minor improvements and cleanup using tree utility functions. Jun 27, 2025
@carlosgmartin carlosgmartin force-pushed the minor_improvements_using_tree_utils branch from 40ca000 to e0f0add Compare July 2, 2025 01:44
@carlosgmartin carlosgmartin force-pushed the minor_improvements_using_tree_utils branch from e0f0add to a571029 Compare July 2, 2025 01:57
@carlosgmartin
Copy link
Copy Markdown
Contributor Author

@vroulet Are there any changes you'd like me to make to this PR?

Copy link
Copy Markdown
Collaborator

@rdyro rdyro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @carlosgmartin ! Let's merge this!

@copybara-service copybara-service Bot merged commit 691f69e into google-deepmind:main Mar 24, 2026
15 checks passed
@carlosgmartin carlosgmartin deleted the minor_improvements_using_tree_utils branch March 24, 2026 18:47
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.

3 participants