浏览代码

remove obsolete code, offset worker seeds (#3645)

/bug-failed-api-check
GitHub 5 年前
当前提交
2ecd1d9b
共有 2 个文件被更改,包括 4 次插入7 次删除
  1. 2
      docs/Python-API.md
  2. 9
      ml-agents/mlagents/trainers/learn.py

2
docs/Python-API.md


- `worker_id` indicates which port to use for communication with the
environment. For use in parallel training regimes such as A3C.
- `seed` indicates the seed to use when generating random numbers during the
training process. In environments which do not involve physics calculations,
training process. In environments which are deterministic,
setting the seed enables reproducible experimentation by ensuring that the
environment and trainers utilize the same random seed.
- `side_channels` provides a way to exchange data with the Unity simulation that

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


env_path: Optional[str],
docker_target_name: Optional[str],
no_graphics: bool,
seed: Optional[int],
seed: int,
start_port: int,
env_args: Optional[List[str]],
) -> Callable[[int, List[SideChannel]], BaseEnv]:

# container.
# Navigate in docker path and find env_path and copy it.
env_path = prepare_for_docker_run(docker_target_name, env_path)
seed_count = 10000
seed_pool = [np.random.randint(0, seed_count) for _ in range(seed_count)]
env_seed = seed
if not env_seed:
env_seed = seed_pool[worker_id % len(seed_pool)]
# Make sure that each environment gets a different seed
env_seed = seed + worker_id
return UnityEnvironment(
file_name=env_path,
worker_id=worker_id,

正在加载...
取消
保存