浏览代码

Merge pull request #400 from Unity-Technologies/docs/python-api

clarify the python docs and learn.py help message
/develop-generalizationTraining-TrainerController
GitHub 7 年前
当前提交
0c6aaa1e
共有 2 个文件被更改,包括 5 次插入6 次删除
  1. 7
      docs/Python-API.md
  2. 4
      python/learn.py

7
docs/Python-API.md


## Loading a Unity Environment
Python-side communication happens through `UnityEnvironment` which is located in `python/unityagents`. To load a Unity environment from a built binary file, put the file in the same directory as `unityagents`. In python, run:
Python-side communication happens through `UnityEnvironment` which is located in `python/unityagents`. To load a Unity environment from a built binary file, put the file in the same directory as `unityagents`. If your filename is 3DBall.app, in python, run:
env = UnityEnvironment(file_name=filename, worker_id=0)
env = UnityEnvironment(file_name="3DBall", worker_id=0)
* `file_name` is the name of the environment binary (located in the root directory of the python project).
* `file_name` is the name of the environment binary (located in the root directory of the python project).
* `worker_id` indicates which port to use for communication with the environment. For use in parallel training regimes such as A3C.
## Interacting with a Unity Environment

4
python/learn.py


logger = logging.getLogger("unityagents")
_USAGE = '''
Usage:
learn (<env>) [options]
learn (<env>) [options]
learn --help
--help Show this message.
--curriculum=<file> Curriculum json file for environment [default: None].
--keep-checkpoints=<n> How many model checkpoints to keep [default: 5].
--lesson=<n> Start learning from this lesson [default: 0].

正在加载...
取消
保存