Skip to content

Commit

Permalink
move logging
Browse files Browse the repository at this point in the history
  • Loading branch information
albertbou92 committed Dec 5, 2023
1 parent fb6f61a commit 2346870
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/dqn/dqn_atari.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def main(cfg: "DictConfig"): # noqa: F821
)

if collected_frames < init_random_frames:
if logger:
for key, value in log_info.items():
logger.log_scalar(key, value, step=collected_frames)
continue

# optimization steps
Expand Down
6 changes: 5 additions & 1 deletion examples/dqn/dqn_cartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ def main(cfg: "DictConfig"): # noqa: F821
)

if collected_frames < init_random_frames:
continue
if collected_frames < init_random_frames:
if logger:
for key, value in log_info.items():
logger.log_scalar(key, value, step=collected_frames)
continue

# optimization steps
training_start = time.time()
Expand Down

0 comments on commit 2346870

Please sign in to comment.