浏览代码

Merge experiments

/develop/jit/experiments
Ervin Teng 4 年前
当前提交
3a7cd3ad
共有 3 个文件被更改,包括 13 次插入7 次删除
  1. 4
      config/sac/CrawlerStatic.yaml
  2. 11
      ml-agents/mlagents/torch_utils/torch.py
  3. 5
      ml-agents/mlagents/trainers/learn.py

4
config/sac/CrawlerStatic.yaml


gamma: 0.995
strength: 1.0
keep_checkpoints: 5
max_steps: 3000000
max_steps: 100000
threaded: true
threaded: false

11
ml-agents/mlagents/torch_utils/torch.py


# Everywhere else is caught by the banned-modules setting for flake8
import torch # noqa I201
torch.set_num_interop_threads(2)
os.environ["KMP_AFFINITY"] = "granularity=fine,compact,1,0"
os.environ["KMP_BLOCKTIME"] = "0"
if "TORCH_NUM_THREADS" in os.environ:
torch.set_num_threads(int(os.environ.get("TORCH_NUM_THREADS")))
if "TORCH_NUM_INTEROP" in os.environ:
torch.set_num_interop_threads(int(os.environ.get("TORCH_NUM_INTEROP")))
# torch.set_num_interop_threads(4)
# os.environ["KMP_AFFINITY"] = "granularity=fine,compact,1,0"
# os.environ["KMP_BLOCKTIME"] = "1"
# Known PyLint compatibility with PyTorch https://github.com/pytorch/pytorch/issues/701
# pylint: disable=E1101

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


import json
import cProfile
from mlagents_envs.registry import default_registry
from typing import Callable, Optional, List
import mlagents.trainers

) -> UnityEnvironment:
# Make sure that each environment gets a different seed
env_seed = seed + worker_id
return UnityEnvironment(
file_name=env_path,
return default_registry["CrawlerStaticTarget"].make(
worker_id=worker_id,
seed=env_seed,
no_graphics=no_graphics,

正在加载...
取消
保存