[RLlib] Trajectory view API: Simple List Collector (on by default for PPO); LSTM-agnostic (#11056)

This commit is contained in:
Sven Mika
2020-10-01 16:57:10 +02:00
committed by GitHub
parent 0d93b1de93
commit 36bda8432b
40 changed files with 1154 additions and 1173 deletions
+16 -17
View File
@@ -9,7 +9,6 @@ For PyTorch / TF eager mode, use the --torch and --eager flags.
import argparse
import ray
from ray import tune
from ray.rllib.models import ModelCatalog
from ray.rllib.examples.env.simple_rpg import SimpleRPG
@@ -21,25 +20,25 @@ parser.add_argument(
"--framework", choices=["tf", "tfe", "torch"], default="tf")
if __name__ == "__main__":
ray.init(local_mode=True)
args = parser.parse_args()
if args.framework == "torch":
ModelCatalog.register_custom_model("my_model", CustomTorchRPGModel)
else:
ModelCatalog.register_custom_model("my_model", CustomTFRPGModel)
tune.run(
"PG",
stop={
"timesteps_total": 1,
config = {
"framework": args.framework,
"env": SimpleRPG,
"rollout_fragment_length": 1,
"train_batch_size": 2,
"num_workers": 0,
"model": {
"custom_model": "my_model",
},
config={
"framework": args.framework,
"env": SimpleRPG,
"rollout_fragment_length": 1,
"train_batch_size": 2,
"num_workers": 0,
"model": {
"custom_model": "my_model",
},
},
)
}
stop = {
"timesteps_total": 1,
}
tune.run("PG", config=config, stop=stop, verbose=1)