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(zjow): add wandb logger features; fix relative bugs for wandb online logger #579

Merged
merged 63 commits into from
Mar 16, 2023

Conversation

zjowowen
Copy link
Collaborator

Description

Add and fix wandb logger features for rendering videos and logging information during training, which is tested in algorithms td3/ddpg/sac.
Fix relative bugs for wandb online logger.
Copy changes to wandb offline logger.

@zjowowen zjowowen added bug Something isn't working enhancement New feature or request P2 Important issue, but not time-critical refactor refactor module or component labels Feb 10, 2023
@zjowowen zjowowen self-assigned this Feb 10, 2023
@zjowowen zjowowen changed the title feature(zjow): Add wandb logger features; fix relative bugs for wandb online logger feature(zjow): add wandb logger features; fix relative bugs for wandb online logger Feb 10, 2023
@PaParaZz1 PaParaZz1 removed the P2 Important issue, but not time-critical label Feb 13, 2023
ding/framework/middleware/functional/collector.py Outdated Show resolved Hide resolved
ding/policy/ddpg.py Show resolved Hide resolved
ding/policy/ddpg.py Outdated Show resolved Hide resolved
@PaParaZz1 PaParaZz1 removed the bug Something isn't working label Feb 23, 2023
@codecov
Copy link

codecov bot commented Feb 28, 2023

Codecov Report

Merging #579 (bb35f90) into main (275141b) will decrease coverage by 0.39%.
The diff coverage is 10.99%.

❗ Current head bb35f90 differs from pull request most recent head 6f49d0a. Consider uploading reports for the commit 6f49d0a to get more accurate results

@@            Coverage Diff             @@
##             main     #579      +/-   ##
==========================================
- Coverage   83.34%   82.96%   -0.39%     
==========================================
  Files         569      570       +1     
  Lines       46819    47013     +194     
==========================================
- Hits        39022    39004      -18     
- Misses       7797     8009     +212     
Flag Coverage Δ
unittests 82.96% <10.99%> (-0.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
ding/bonus/__init__.py 0.00% <0.00%> (ø)
ding/bonus/config.py 0.00% <0.00%> (ø)
ding/bonus/ppof.py 0.00% <0.00%> (ø)
ding/bonus/td3.py 0.00% <0.00%> (ø)
ding/framework/middleware/functional/ctx_helper.py 41.17% <ø> (ø)
ding/framework/middleware/functional/logger.py 22.44% <13.63%> (-1.28%) ⬇️
ding/envs/env_manager/base_env_manager.py 87.91% <40.00%> (-0.82%) ⬇️
ding/policy/ddpg.py 82.71% <47.36%> (-5.13%) ⬇️
ding/envs/env/ding_env_wrapper.py 84.07% <50.00%> (+4.31%) ⬆️
ding/framework/middleware/functional/evaluator.py 41.99% <50.00%> (-0.12%) ⬇️
... and 6 more

... and 8 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

ding/bonus/ppof.py Outdated Show resolved Hide resolved
ding/bonus/ppof.py Outdated Show resolved Hide resolved
ding/policy/ddpg.py Outdated Show resolved Hide resolved
@@ -1,6 +1,7 @@
from typing import TYPE_CHECKING, Callable, List, Tuple, Any
from easydict import EasyDict
from functools import reduce
import numpy as np
Copy link
Member

Choose a reason for hiding this comment

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

remove this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@@ -257,7 +257,7 @@ def _evaluate(ctx: Union["OnlineRLContext", "OfflineRLContext"]):
eval_monitor.update_video(env.ready_imgs)
eval_monitor.update_output(inference_output)
output = [v for v in inference_output.values()]
action = [to_ndarray(v['action']) for v in output] # TBD
action = np.array([to_ndarray(v['action']) for v in output]) # TBD
Copy link
Member

Choose a reason for hiding this comment

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

the same problem

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

ding/bonus/config.py Show resolved Hide resolved
ding/bonus/ppof.py Show resolved Hide resolved

def monitor_vars(self) -> List[str]:
variables = ["q_value", "target q_value", "loss", "lr", "entropy", "target_q_value", "td_error"]
return variables
Copy link
Member

Choose a reason for hiding this comment

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

directly return

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

wandb_url: str


class TD3:
Copy link
Member

Choose a reason for hiding this comment

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

rename to OffPolicyAgent

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@PaParaZz1 PaParaZz1 merged commit cdb5ffa into opendilab:main Mar 16, 2023
@zjowowen zjowowen deleted the benchmark-3 branch October 7, 2023 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor refactor module or component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants