浏览代码

[skip ci] adding action=DetectDefault in parser

/trainer-plugin
Anupam Bhatnagar 4 年前
当前提交
3d82b7c2
共有 3 个文件被更改,包括 15 次插入7 次删除
  1. 3
      ml-agents/mlagents/trainers/cli_utils.py
  2. 13
      ml-agents/mlagents/trainers/settings.py
  3. 6
      ml-agents/mlagents/trainers/initializer.py

3
ml-agents/mlagents/trainers/cli_utils.py


type=str,
nargs="*",
help="Absolute paths of plugins to be loaded",
required=False
required=False,
action=DetectDefault
)
argparser.add_argument(
"--env-args",

13
ml-agents/mlagents/trainers/settings.py


no_graphics: bool = parser.get_default("no_graphics")
@attr.s(auto_attribs=True)
class PluginSettings:
plugins: Optional[List[str]] = parser.get_default("plugins")
# @attr.s(auto_attribs=True)
# class PluginSettings:
# plugins: Optional[List[str]] = parser.get_default("plugins")
#
@attr.s(auto_attribs=True)
class RunOptions(ExportableSettings):

engine_settings: EngineSettings = attr.ib(factory=EngineSettings)
environment_parameters: Optional[Dict[str, EnvironmentParameterSettings]] = None
checkpoint_settings: CheckpointSettings = attr.ib(factory=CheckpointSettings)
plugin_settings: PluginSettings = attr.ib(factory=PluginSettings)
# plugin_settings: PluginSettings = attr.ib(factory=PluginSettings)
plugins = parser.get_default("plugins")
cattr.register_structure_hook(PluginSettings, strict_to_cls)
# cattr.register_structure_hook(PluginSettings, strict_to_cls)
cattr.register_structure_hook(EngineSettings, strict_to_cls)
cattr.register_structure_hook(CheckpointSettings, strict_to_cls)
cattr.register_structure_hook(

6
ml-agents/mlagents/trainers/initializer.py


class Initializer:
def __init__(self):
pass
def load(self):
pass
正在加载...
取消
保存