Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docstring cosmetic improvements #879

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions optax/_src/combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def multi_transform(
import jax.numpy as jnp
def map_nested_fn(fn):
'''Recursively apply `fn` to the key-value pairs of a nested dict'''
'''Recursively apply `fn` to the key-value pairs of a nested dict.'''
def map_fn(nested_dict):
return {k: (map_fn(v) if isinstance(v, dict) else fn(k, v))
for k, v in nested_dict.items()}
Expand Down Expand Up @@ -178,7 +178,7 @@ def map_fn(nested_dict):
param_labels)
If you would like to not optimize some parameters, you may wrap
``optax.multi_transform`` with :func:`optax.masked`.
:func:`optax.multi_transform` with :func:`optax.masked`.
Args:
transforms: A mapping from labels to transformations. Each transformation
Expand All @@ -191,7 +191,8 @@ def map_fn(nested_dict):
extra_arg fields with the same tree structure as params/updates.
Returns:
An ``optax.GradientTransformation``.
A :func:`optax.GradientTransformationExtraArgs` that implements an ``init``
and ``update`` function.
"""

transforms = {
Expand Down
Loading