浏览代码

add docstring for maybe_add_samplers

/sampler-refactor-copy
Andrew Cohen 5 年前
当前提交
56479c12
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 7
      ml-agents/mlagents/trainers/learn.py

7
ml-agents/mlagents/trainers/learn.py


options.curriculum, env_manager, restore=checkpoint_settings.resume
)
maybe_add_samplers(options.parameter_randomization, env_manager, run_seed)
trainer_factory = TrainerFactory(
options.behaviors,
checkpoint_settings.run_id,

def maybe_add_samplers(
sampler_config: Optional[Dict], env: SubprocessEnvManager, run_seed: int
) -> None:
"""
Adds samplers to env if sampler config provided and sets seed if not configured.
:param sampler_config: validated dict of sampler configs. None if not included.
:param env: env manager to pass samplers via reset
:param run_seed: Random seed used for training.
"""
if sampler_config is not None:
# If the seed is not specified in yaml, this will grab the run seed
for _, v in sampler_config.items():

正在加载...
取消
保存