[RLlib] Examples folder restructuring (Model examples; final part). (#8278)

- This PR completes any previously missing PyTorch Model counterparts to TFModels in examples/models.
- It also makes sure, all example scripts in the rllib/examples folder are tested for both frameworks and learn the given task (this is often currently not checked) using a --as-test flag in connection with a --stop-reward.
This commit is contained in:
Sven Mika
2020-05-12 08:23:10 +02:00
committed by GitHub
parent 9d012626e5
commit 57544b1ff9
41 changed files with 1466 additions and 1584 deletions
@@ -13,8 +13,8 @@ import ray
from ray import tune
from ray.rllib.evaluation import RolloutWorker
from ray.rllib.evaluation.metrics import collect_metrics
from ray.rllib.policy.policy import Policy
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.policy.tests.test_policy import TestPolicy
parser = argparse.ArgumentParser()
parser.add_argument("--gpu", action="store_true")
@@ -23,7 +23,7 @@ parser.add_argument("--num-workers", type=int, default=2)
parser.add_argument("--num-cpus", type=int, default=0)
class CustomPolicy(TestPolicy):
class CustomPolicy(Policy):
"""Example of a custom policy written from scratch.
You might find it more convenient to extend TF/TorchPolicy instead