mirror of
https://github.com/wassname/ray.git
synced 2026-08-12 12:20:11 +08:00
[tune] Support user-defined trainable functions / classes / envs with a shared object registry (#1226)
This commit is contained in:
@@ -19,10 +19,19 @@ import shlex
|
||||
# These lines added to enable Sphinx to work without installing Ray.
|
||||
import mock
|
||||
MOCK_MODULES = ["gym",
|
||||
"gym.spaces",
|
||||
"scipy",
|
||||
"scipy.signal",
|
||||
"tensorflow",
|
||||
"tensorflow.contrib",
|
||||
"tensorflow.contrib.layers",
|
||||
"tensorflow.contrib.slim",
|
||||
"tensorflow.contrib.rnn",
|
||||
"tensorflow.core",
|
||||
"tensorflow.core.util",
|
||||
"tensorflow.python",
|
||||
"tensorflow.python.client",
|
||||
"tensorflow.python.util",
|
||||
"pyarrow",
|
||||
"pyarrow.plasma",
|
||||
"smart_open",
|
||||
|
||||
@@ -25,7 +25,7 @@ You can run the code with
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python/ray/rllib/train.py --env=Pong-ram-v4 --alg=A3C --config='{"num_workers": N}'
|
||||
python/ray/rllib/train.py --env=Pong-ram-v4 --run=A3C --config='{"num_workers": N}'
|
||||
|
||||
Reinforcement Learning
|
||||
----------------------
|
||||
|
||||
@@ -18,7 +18,7 @@ on the ``Humanoid-v1`` gym environment.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python/ray/rllib/train.py --env=Humanoid-v1 --alg=ES
|
||||
python/ray/rllib/train.py --env=Humanoid-v1 --run=ES
|
||||
|
||||
To train a policy on a cluster (e.g., using 900 workers), run the following.
|
||||
|
||||
@@ -26,7 +26,7 @@ To train a policy on a cluster (e.g., using 900 workers), run the following.
|
||||
|
||||
python ray/python/ray/rllib/train.py \
|
||||
--env=Humanoid-v1 \
|
||||
--alg=ES \
|
||||
--run=ES \
|
||||
--redis-address=<redis-address> \
|
||||
--config='{"num_workers": 900, "episodes_per_batch": 10000, "timesteps_per_batch": 100000}'
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Then you can run the example as follows.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python/ray/rllib/train.py --env=Pong-ram-v4 --alg=PPO
|
||||
python/ray/rllib/train.py --env=Pong-ram-v4 --run=PPO
|
||||
|
||||
This will train an agent on the ``Pong-ram-v4`` Atari environment. You can also
|
||||
try passing in the ``Pong-v0`` environment or the ``CartPole-v0`` environment.
|
||||
|
||||
@@ -30,7 +30,7 @@ You can run training with
|
||||
|
||||
::
|
||||
|
||||
python ray/python/ray/rllib/train.py --env CartPole-v0 --alg PPO --config '{"timesteps_per_batch": 10000}'
|
||||
python ray/python/ray/rllib/train.py --env CartPole-v0 --run PPO --config '{"timesteps_per_batch": 10000}'
|
||||
|
||||
By default, the results will be logged to a subdirectory of ``/tmp/ray``.
|
||||
This subdirectory will contain a file ``config.json`` which contains the
|
||||
@@ -51,7 +51,7 @@ The ``train.py`` script has a number of options you can show by running
|
||||
|
||||
The most important options are for choosing the environment
|
||||
with ``--env`` (any OpenAI gym environment including ones registered by the user
|
||||
can be used) and for choosing the algorithm with ``--alg``
|
||||
can be used) and for choosing the algorithm with ``-run``
|
||||
(available options are ``PPO``, ``A3C``, ``ES`` and ``DQN``). Each algorithm
|
||||
has specific hyperparameters that can be set with ``--config``, see the
|
||||
``DEFAULT_CONFIG`` variable in
|
||||
|
||||
Reference in New Issue
Block a user