浏览代码

Addressing Arthur's PR comments.

- Renamed `ml-agents-protobuf` to `protobuf-definitions`.
- Renamed `python/mlagents` to `python/ml-agents`.
- Removed comments from setup.py.
/develop-generalizationTraining-TrainerController
Deric Pang 6 年前
当前提交
479f7046
共有 13 个文件被更改,包括 60 次插入12 次删除
  1. 6
      Dockerfile
  2. 9
      docs/Installation.md
  3. 2
      docs/Learning-Environment-Executable.md
  4. 4
      docs/Python-API.md
  5. 2
      docs/Training-ML-Agents.md
  6. 2
      protobuf-defintions/make.bat
  7. 47
      python/ml-agents/setup.py
  8. 0
      /protobuf-defintions
  9. 0
      /python/ml-agents/tests
  10. 0
      /python/ml-agents/requirements.txt
  11. 0
      /python/ml-agents/mlagents

6
Dockerfile


RUN apt-get install -y xvfb
COPY python/mlagents/requirements.txt .
COPY python/ml-agents/requirements.txt .
COPY python/mlagents /mlagents
WORKDIR /mlagents
COPY python/ml-agents /ml-agents
WORKDIR /ml-agents
RUN pip install .
# port 5005 is the port used in in Editor training.

9
docs/Installation.md


git clone https://github.com/Unity-Technologies/ml-agents.git
The `MLAgentsSDK` directory in this repository contains the Unity Assets
to add to your projects. The `mlagents` directory contains the python package
which provides trainers and a python API to interface with Unity.
to add to your projects. The `python` directory contains python packages
which provide trainers, a python API to interface with Unity, and a package
to interface with OpenAI Gym.
the dependencies listed in the [requirements file](../python/mlagents/requirements.txt).
the dependencies listed in the [requirements file](../python/ml-agents/requirements.txt).
Some of the primary dependencies include:
- [TensorFlow](Background-TensorFlow.md)

[instructions](https://packaging.python.org/guides/installing-using-linux-tools/#installing-pip-setuptools-wheel-with-linux-package-managers)
on installing it.
To install dependencies, enter the `python/mlagents/` directory and run from
To install dependencies, enter the `python/ml-agents/` directory and run from
the command line:
pip install -r requirements.txt

2
docs/Learning-Environment-Executable.md


**Note**: If you're using Anaconda, don't forget to activate the ml-agents environment first.
If the `mlagents-learn` runs correctly and starts training, you should see something like this:
If `mlagents-learn` runs correctly and starts training, you should see something like this:
![Training running](images/training-running.png)

4
docs/Python-API.md


- **BrainParameters** — describes the data elements in a BrainInfo object. For
example, provides the array length of an observation in BrainInfo.
These classes are all defined in the `python/mlagents/mlagents/envs` folder of
These classes are all defined in the `python/ml-agents/mlagents/envs` folder of
the ML-Agents SDK.
To communicate with an agent in a Unity environment from a Python program, the

## Loading a Unity Environment
Python-side communication happens through `UnityEnvironment` which is located in
`python/mlagents/mlagents/envs`. To load a Unity environment from a built binary
`python/ml-agents/mlagents/envs`. To load a Unity environment from a built binary
file, put the file in the same directory as `envs`. For example, if the filename
of your Unity environment is 3DBall.app, in python, run:

2
docs/Training-ML-Agents.md


The output of the training process is a model file containing the optimized policy. This model file is a TensorFlow data graph containing the mathematical operations and the optimized weights selected during the training process. You can use the generated model file with the Internal Brain type in your Unity project to decide the best course of action for an agent.
Use the command `mlagents-learn` to train your agents. This command is installed with the `mlagents` package
and its implementation can be found at `python/mlagents/learn.py`. The [configuration file](#training-config-file), `trainer_config.yaml` specifies the hyperparameters used during training. You can edit this file with a text editor to add a specific configuration for each brain.
and its implementation can be found at `python/ml-agents/learn.py`. The [configuration file](#training-config-file), `trainer_config.yaml` specifies the hyperparameters used during training. You can edit this file with a text editor to add a specific configuration for each brain.
For a broader overview of reinforcement learning, imitation learning and the ML-Agents training process, see [ML-Agents Toolkit Overview](ML-Agents-Overview.md).

2
protobuf-defintions/make.bat


SRC_DIR=proto/mlagents/envs/communicator_objects
DST_DIR_C=../MLAgentsSDK/Assets/ML-Agents/Scripts/CommunicatorObjects
DST_DIR_P=../python/mlagents
DST_DIR_P=../python/ml-agents
PROTO_PATH=proto
PYTHON_PACKAGE=mlagents/envs/communicator_objects

47
python/ml-agents/setup.py


from setuptools import setup, find_packages
from os import path
from io import open
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, '../../README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='mlagents',
version='0.4.0',
description='Unity Machine Learning Agents',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/Unity-Technologies/ml-agents',
author='Unity Technologies',
author_email='ML-Agents@unity3d.com',
classifiers=[
'Intended Audience :: Developers',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3.6'
],
packages=find_packages(exclude=['tests', 'tests.*', '*.tests', '*.tests.*']), # Required
install_requires=[
'tensorflow>=1.7',
'Pillow>=4.2.1',
'matplotlib',
'numpy>=1.13.3,<=1.14.5',
'jupyter',
'pytest>=3.2.2',
'docopt',
'pyyaml',
'protobuf>=3.6.0',
'grpcio>=1.11.0'],
entry_points={
'console_scripts': [
'mlagents-learn=mlagents.learn:main',
],
},
)

/ml-agents-protobuf → /protobuf-defintions

/python/mlagents/tests → /python/ml-agents/tests

/python/mlagents/requirements.txt → /python/ml-agents/requirements.txt

/python/mlagents/mlagents → /python/ml-agents/mlagents

正在加载...
取消
保存