-
Notifications
You must be signed in to change notification settings - Fork 371
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
refactor(lyd): refactor dt_policy in new pipeline #687
Conversation
@@ -1174,6 +1174,23 @@ def reset(self): | |||
return self.env.reset() | |||
|
|||
|
|||
class AllinObsWrapper(gym.Wrapper): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add overview description for this wrapper
@@ -42,7 +42,8 @@ | |||
|
|||
from .d4pg import D4PGPolicy | |||
from .cql import CQLPolicy, CQLDiscretePolicy | |||
from .decision_transformer import DTPolicy | |||
# from .decision_transformer import DTPolicy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the commented code
ding/policy/dt.py
Outdated
class DTPolicy(Policy): | ||
r""" | ||
Overview: | ||
Policy class of DT algorithm in discrete environments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the full name of DT and the paper link
ding/policy/dt.py
Outdated
|
||
def _init_learn(self) -> None: | ||
r""" | ||
Overview: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish indents
@@ -27,7 +27,7 @@ | |||
embed_dim=128, | |||
n_heads=1, | |||
dropout_p=0.1, | |||
log_dir='/home/puyuan/DI-engine/dizoo/box2d/lunarlander/dt_log_1000eps', | |||
log_dir='/mnt/nfs/luyd/DI-engine/dizoo/box2d/lunarlander/dt_log_1000eps', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't upload the absolute path
@@ -0,0 +1,2 @@ | |||
duration,num_updates,eval_avg_reward,eval_avg_ep_len,eval_d4rl_score |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unnecessary log files
ding/utils/data/dataset.py
Outdated
|
||
self.context_len = context_len | ||
def __init__(self, cfg: dict) -> None: | ||
dataset_path = cfg.policy.collect.get('data_path', None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use xxx.get
, we must ensure all the configs are fixed after compile_config
|
||
self.running_rtg = [self.rtg_target / self.rtg_scale] * self.eval_batch_size | ||
self.t = [0] * self.eval_batch_size | ||
self.timesteps = torch.arange(start=0, end=self.max_eval_ep_len, step=1).repeat(self.eval_batch_size, 1).to(self.device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indicate device when use torch.arange
Description
新的pipeline下DT效果不如旧的pipeline好