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

[Feature] Log pbar rate in SOTA implementations #2662

Merged
merged 9 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update
[ghstack-poisoned]
  • Loading branch information
vmoens committed Dec 17, 2024
commit 7444057268ca59bee5395ebec1aeeb85cc42467c
4 changes: 3 additions & 1 deletion sota-implementations/decision_transformer/dt.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def main(cfg: "DictConfig"): # noqa: F821
loss_module = make_dt_loss(cfg.loss, actor, device=model_device)

# Create optimizer
transformer_optim, scheduler = make_dt_optimizer(cfg.optim, loss_module)
transformer_optim, scheduler = make_dt_optimizer(
cfg.optim, loss_module, model_device
)

# Create inference policy
inference_policy = DecisionTransformerInferenceWrapper(
Expand Down
4 changes: 2 additions & 2 deletions sota-implementations/decision_transformer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,10 @@ def make_odt_optimizer(optim_cfg, loss_module):
return dt_optimizer, log_temp_optimizer, scheduler


def make_dt_optimizer(optim_cfg, loss_module):
def make_dt_optimizer(optim_cfg, loss_module, device):
dt_optimizer = torch.optim.Adam(
loss_module.actor_network_params.flatten_keys().values(),
lr=torch.as_tensor(optim_cfg.lr),
lr=torch.tensor(optim_cfg.lr, device=device),
weight_decay=optim_cfg.weight_decay,
eps=1.0e-8,
)
Expand Down
2 changes: 1 addition & 1 deletion sota-implementations/dqn/config_atari.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ loss:

compile:
compile: False
compile_mode:
compile_mode: default
cudagraphs: False
Loading