-
Notifications
You must be signed in to change notification settings - Fork 118
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(rjy): add crowd md env new, and multi-head policy #230
base: main
Are you sure you want to change the base?
Conversation
fix(rjy): fix crowd env scale/add entropy info
…nto rjy-crowd-md-env-new
@@ -93,7 +93,12 @@ def __init__( | |||
cfg.main_config.exp_name = exp_name | |||
self.origin_cfg = cfg | |||
self.cfg = compile_config( | |||
cfg.main_config, seed=seed, env=None, auto=True, policy=SampledEfficientZeroPolicy, create_cfg=cfg.create_config | |||
cfg.main_config, | |||
seed=seed, |
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.
多了一个空行吗
if observation_array.ndim == 3: | ||
# Flatten the last two dimensions | ||
observation_array = observation_array.reshape(batch_size, -1) | ||
else: | ||
raise ValueError("For 'mlp' model_type, the observation must have 3 dimensions [B, S, O]") | ||
|
||
elif model_type == 'rgcn': | ||
if observation_array.ndim == 4: | ||
# TODO(rjy): strage process |
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.
strage process是什么意思?
activation: Optional[nn.Module] = nn.ReLU(inplace=True), | ||
last_linear_layer_init_zero: bool = True, | ||
norm_type: Optional[str] = 'BN', | ||
self, |
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.
bash format.sh一下
output_support_size: int = 601, | ||
last_linear_layer_init_zero: bool = True, | ||
activation: Optional[nn.Module] = nn.ReLU(inplace=True), | ||
norm_type: Optional[str] = 'BN', |
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.
这些缩进还是换成原来的格式哈
""" | ||
Overview: | ||
Relational graph convolutional network layer. | ||
""" |
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.
给一下这里代码实现的参考链接
@@ -0,0 +1,113 @@ | |||
from typing import Union, Optional |
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.
文件名改为 crowdsim_env
@ENV_REGISTRY.register('crowdsim_lightzero') | ||
class CrowdSimEnv(BaseEnv): | ||
|
||
def __init__(self, cfg: dict = {}) -> 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.
增加overview注释
return len(self.queue) | ||
|
||
|
||
# # Example of using the InformationQueue class |
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.
确认这里的example能够正常运行
@ENV_REGISTRY.register('crowdsim_lightzero') | ||
class CrowdSimEnv(BaseEnv): | ||
|
||
def __init__(self, cfg: dict = {}) -> 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.
增加overview注释,将之前的文档中英文版本放在这里的envs/路径下面哈
mcfg['obs_mode'] = '1-dim-array' | ||
env = CrowdSimEnv(mcfg) | ||
env.seed(314) | ||
env.enable_save_replay('/home/nighoodRen/LightZero/result/test_replay') |
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.
个人信息替换成template
|
||
|
||
@MODEL_REGISTRY.register('MuZeroModelMD') | ||
class MuZeroModelMD(nn.Module): |
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.
所有增加的文件都需要继承自已有的文件,以避免冗余代码哈,只重写修改过的method。例如这里需要继承自MuZeroModel。相应的注释也需要更新一下。
New Environment: CrowdSim
Multi-Head Policy Version for MuZero, EfficientZero, and Sampled EfficientZero