Skip to content

feat: Adan optimizer integration #181

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

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Changes from 2 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
6 changes: 3 additions & 3 deletions torchopt/transform/scale_by_adan.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ def _scale_by_adan(
tree_map = pytree.tree_map # type: ignore[assignment]

def init_fn(params: Params) -> OptState:
zero = tree_map( # count init
tree_map( # count init
lambda t: torch.zeros(1, dtype=torch.int64, device=t.device).squeeze_(),
params,
)
mu = tree_map( # first moment
mu = tree_map( # first moment
lambda t: torch.zeros_like(t, requires_grad=moment_requires_grad),
params,
)
nu = tree_map( # second moment
nu = tree_map( # second moment
torch.zeros_like,
params,
)
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy