common.py 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. import argparse
  2. from dataclasses import dataclass
  3. from enum import Enum
  4. import os.path
  5. import tempfile
  6. import typer
  7. from typing import Optional
  8. import requests
  9. from ray.tune.experiment.config_parser import _make_parser
  10. from ray.tune.result import DEFAULT_RESULTS_DIR
  11. class FrameworkEnum(str, Enum):
  12. """Supported frameworks for RLlib, used for CLI argument validation."""
  13. tf = "tf"
  14. tf2 = "tf2"
  15. torch = "torch"
  16. class SupportedFileType(str, Enum):
  17. """Supported file types for RLlib, used for CLI argument validation."""
  18. yaml = "yaml"
  19. python = "python"
  20. def get_file_type(config_file: str) -> SupportedFileType:
  21. if config_file.endswith(".py"):
  22. file_type = SupportedFileType.python
  23. elif config_file.endswith(".yaml") or config_file.endswith(".yml"):
  24. file_type = SupportedFileType.yaml
  25. else:
  26. raise ValueError(
  27. "Unknown file type for config "
  28. "file: {}. Supported extensions: .py, "
  29. ".yml, .yaml".format(config_file)
  30. )
  31. return file_type
  32. def _create_tune_parser_help():
  33. """Create a Tune dummy parser to access its 'help' docstrings."""
  34. parser = _make_parser(
  35. parser_creator=None,
  36. formatter_class=argparse.RawDescriptionHelpFormatter,
  37. )
  38. return parser.__dict__.get("_option_string_actions")
  39. PARSER_HELP = _create_tune_parser_help()
  40. def download_example_file(
  41. example_file: str,
  42. base_url: Optional[str] = "https://raw.githubusercontent.com/"
  43. + "ray-project/ray/master/rllib/",
  44. ):
  45. """Download the example file (e.g. from GitHub) if it doesn't exist locally.
  46. If the provided example file exists locally, we return it directly.
  47. Not every user will have cloned our repo and cd'ed into this working directory
  48. when using the CLI.
  49. Args:
  50. example_file: The example file to download.
  51. base_url: The base URL to download the example file from. Use this if
  52. 'example_file' is a link relative to this base URL. If set to 'None',
  53. 'example_file' is assumed to be a complete URL (or a local file, in which
  54. case nothing is downloaded).
  55. """
  56. temp_file = None
  57. if not os.path.exists(example_file):
  58. example_url = base_url + example_file if base_url else example_file
  59. print(f">>> Attempting to download example file {example_url}...")
  60. file_type = get_file_type(example_url)
  61. if file_type == SupportedFileType.yaml:
  62. temp_file = tempfile.NamedTemporaryFile(suffix=".yaml")
  63. else:
  64. assert (
  65. file_type == SupportedFileType.python
  66. ), f"`example_url` ({example_url}) must be a python or yaml file!"
  67. temp_file = tempfile.NamedTemporaryFile(suffix=".py")
  68. r = requests.get(example_url)
  69. with open(temp_file.name, "wb") as f:
  70. print(r.content)
  71. f.write(r.content)
  72. print(f" Status code: {r.status_code}")
  73. if r.status_code == 200:
  74. print(f" Downloaded example file to {temp_file.name}")
  75. # only overwrite the file if the download was successful
  76. example_file = temp_file.name
  77. return example_file, temp_file
  78. def get_help(key: str) -> str:
  79. """Get the help string from a parser for a given key.
  80. If e.g. 'resource_group' is provided, we return
  81. the entry for '--resource-group'."""
  82. key = "--" + key
  83. key = key.replace("_", "-")
  84. if key not in PARSER_HELP.keys():
  85. raise ValueError(f"Key {key} not found in parser.")
  86. return PARSER_HELP.get(key).help
  87. example_help = dict(
  88. filter="Filter examples by exact substring match. For instance,"
  89. " --filter=ppo will only show examples that"
  90. " contain the substring 'ppo' in their ID. The same way, -f=recsys"
  91. "will return all recommender system examples.",
  92. )
  93. train_help = dict(
  94. env="The environment specifier to use. This could be an Farama-Foundation "
  95. "Gymnasium specifier (e.g. `CartPole-v1`) or a full class-path (e.g. "
  96. "`ray.rllib.examples.env.simple_corridor.SimpleCorridor`).",
  97. config_file="Use the algorithm configuration from this file.",
  98. filetype="The file type of the config file. Defaults to 'yaml' and can also be "
  99. "'python'.",
  100. experiment_name="Name of the subdirectory under `local_dir` to put results in.",
  101. framework="The identifier of the deep learning framework you want to use."
  102. "Choose between TensorFlow 1.x ('tf'), TensorFlow 2.x ('tf2'), "
  103. "and PyTorch ('torch').",
  104. v="Whether to use INFO level logging.",
  105. vv="Whether to use DEBUG level logging.",
  106. resume="Whether to attempt to resume from previous experiments.",
  107. local_dir=f"Local dir to save training results to. "
  108. f"Defaults to '{DEFAULT_RESULTS_DIR}'.",
  109. local_mode="Run Ray in local mode for easier debugging.",
  110. ray_address="Connect to an existing Ray cluster at this address instead "
  111. "of starting a new one.",
  112. ray_ui="Whether to enable the Ray web UI.",
  113. ray_num_cpus="The '--num-cpus' argument to use if starting a new cluster.",
  114. ray_num_gpus="The '--num-gpus' argument to use if starting a new cluster.",
  115. ray_num_nodes="Emulate multiple cluster nodes for debugging.",
  116. ray_object_store_memory="--object-store-memory to use if starting a new cluster.",
  117. upload_dir="Optional URI to sync training results to (e.g. s3://bucket).",
  118. trace="Whether to attempt to enable eager-tracing for framework=tf2.",
  119. torch="Whether to use PyTorch (instead of tf) as the DL framework. "
  120. "This argument is deprecated, please use --framework to select 'torch'"
  121. "as backend.",
  122. wandb_key="An optional WandB API key for logging all results to your WandB "
  123. "account.",
  124. wandb_project="An optional project name under which to store the training results.",
  125. wandb_run_name="An optional name for the specific run under which to store the "
  126. "training results.",
  127. )
  128. eval_help = dict(
  129. checkpoint="Optional checkpoint from which to roll out. If none provided, we will "
  130. "evaluate an untrained algorithm.",
  131. algo="The algorithm or model to train. This may refer to the name of a built-in "
  132. "Algorithm (e.g. RLlib's `DQN` or `PPO`), or a user-defined trainable "
  133. "function or class registered in the Tune registry.",
  134. env="The environment specifier to use. This could be an Farama-Foundation gymnasium"
  135. " specifier (e.g. `CartPole-v1`) or a full class-path (e.g. "
  136. "`ray.rllib.examples.env.simple_corridor.SimpleCorridor`).",
  137. local_mode="Run Ray in local mode for easier debugging.",
  138. render="Render the environment while evaluating. Off by default",
  139. video_dir="Specifies the directory into which videos of all episode"
  140. "rollouts will be stored.",
  141. steps="Number of time-steps to roll out. The evaluation will also stop if "
  142. "`--episodes` limit is reached first. A value of 0 means no "
  143. "limitation on the number of time-steps run.",
  144. episodes="Number of complete episodes to roll out. The evaluation will also stop "
  145. "if `--steps` (time-steps) limit is reached first. A value of 0 means "
  146. "no limitation on the number of episodes run.",
  147. out="Output filename",
  148. config="Algorithm-specific configuration (e.g. `env`, `framework` etc.). "
  149. "Gets merged with loaded configuration from checkpoint file and "
  150. "`evaluation_config` settings therein.",
  151. save_info="Save the info field generated by the step() method, "
  152. "as well as the action, observations, rewards and done fields.",
  153. use_shelve="Save rollouts into a Python shelf file (will save each episode "
  154. "as it is generated). An output filename must be set using --out.",
  155. track_progress="Write progress to a temporary file (updated "
  156. "after each episode). An output filename must be set using --out; "
  157. "the progress file will live in the same folder.",
  158. )
  159. @dataclass
  160. class CLIArguments:
  161. """Dataclass for CLI arguments and options. We use this class to keep track
  162. of common arguments, like "run" or "env" that would otherwise be duplicated."""
  163. # Common arguments
  164. # __cli_common_start__
  165. Algo = typer.Option(None, "--algo", "--run", "-a", "-r", help=get_help("run"))
  166. AlgoRequired = typer.Option(
  167. ..., "--algo", "--run", "-a", "-r", help=get_help("run")
  168. )
  169. Env = typer.Option(None, "--env", "-e", help=train_help.get("env"))
  170. EnvRequired = typer.Option(..., "--env", "-e", help=train_help.get("env"))
  171. Config = typer.Option("{}", "--config", "-c", help=get_help("config"))
  172. ConfigRequired = typer.Option(..., "--config", "-c", help=get_help("config"))
  173. # __cli_common_end__
  174. # Train file arguments
  175. # __cli_file_start__
  176. ConfigFile = typer.Argument( # config file is now mandatory for "file" subcommand
  177. ..., help=train_help.get("config_file")
  178. )
  179. FileType = typer.Option(
  180. SupportedFileType.yaml, "--type", "-t", help=train_help.get("filetype")
  181. )
  182. # __cli_file_end__
  183. # Train arguments
  184. # __cli_train_start__
  185. Stop = typer.Option("{}", "--stop", "-s", help=get_help("stop"))
  186. ExperimentName = typer.Option(
  187. "default", "--experiment-name", "-n", help=train_help.get("experiment_name")
  188. )
  189. V = typer.Option(False, "--log-info", "-v", help=train_help.get("v"))
  190. VV = typer.Option(False, "--log-debug", "-vv", help=train_help.get("vv"))
  191. Resume = typer.Option(False, help=train_help.get("resume"))
  192. NumSamples = typer.Option(1, help=get_help("num_samples"))
  193. CheckpointFreq = typer.Option(0, help=get_help("checkpoint_freq"))
  194. CheckpointAtEnd = typer.Option(True, help=get_help("checkpoint_at_end"))
  195. LocalDir = typer.Option(DEFAULT_RESULTS_DIR, help=train_help.get("local_dir"))
  196. Restore = typer.Option(None, help=get_help("restore"))
  197. Framework = typer.Option(None, help=train_help.get("framework"))
  198. ResourcesPerTrial = typer.Option(None, help=get_help("resources_per_trial"))
  199. KeepCheckpointsNum = typer.Option(None, help=get_help("keep_checkpoints_num"))
  200. CheckpointScoreAttr = typer.Option(
  201. "training_iteration", help=get_help("sync_on_checkpoint")
  202. )
  203. UploadDir = typer.Option("", help=train_help.get("upload_dir"))
  204. Trace = typer.Option(False, help=train_help.get("trace"))
  205. LocalMode = typer.Option(False, help=train_help.get("local_mode"))
  206. Scheduler = typer.Option("FIFO", help=get_help("scheduler"))
  207. SchedulerConfig = typer.Option("{}", help=get_help("scheduler_config"))
  208. RayAddress = typer.Option(None, help=train_help.get("ray_address"))
  209. RayUi = typer.Option(False, help=train_help.get("ray_ui"))
  210. RayNumCpus = typer.Option(None, help=train_help.get("ray_num_cpus"))
  211. RayNumGpus = typer.Option(None, help=train_help.get("ray_num_gpus"))
  212. RayNumNodes = typer.Option(None, help=train_help.get("ray_num_nodes"))
  213. RayObjectStoreMemory = typer.Option(
  214. None, help=train_help.get("ray_object_store_memory")
  215. )
  216. WandBKey = typer.Option(None, "--wandb-key", help=train_help.get("wandb_key"))
  217. WandBProject = typer.Option(
  218. None, "--wandb-project", help=eval_help.get("wandb_project")
  219. )
  220. WandBRunName = typer.Option(
  221. None, "--wandb-run-name", help=eval_help.get("wandb_run_name")
  222. )
  223. # __cli_train_end__
  224. # Eval arguments
  225. # __cli_eval_start__
  226. Checkpoint = typer.Argument(None, help=eval_help.get("checkpoint"))
  227. Render = typer.Option(False, help=eval_help.get("render"))
  228. Steps = typer.Option(10000, help=eval_help.get("steps"))
  229. Episodes = typer.Option(0, help=eval_help.get("episodes"))
  230. Out = typer.Option(None, help=eval_help.get("out"))
  231. SaveInfo = typer.Option(False, help=eval_help.get("save_info"))
  232. UseShelve = typer.Option(False, help=eval_help.get("use_shelve"))
  233. TrackProgress = typer.Option(False, help=eval_help.get("track_progress"))
  234. # __cli_eval_end__
  235. # Note that the IDs of these examples are lexicographically sorted by environment,
  236. # not by algorithm. This should be more natural for users, but could be changed easily.
  237. EXAMPLES = {
  238. # A2C
  239. "atari-a2c": {
  240. "file": "tuned_examples/a2c/atari-a2c.yaml",
  241. "description": "Runs grid search over several Atari games on A2C.",
  242. },
  243. "cartpole-a2c": {
  244. "file": "tuned_examples/a2c/cartpole_a2c.py",
  245. "stop": "{'timesteps_total': 50000, 'episode_reward_mean': 200}",
  246. "description": "Runs A2C on the CartPole-v1 environment.",
  247. },
  248. "cartpole-a2c-micro": {
  249. "file": "tuned_examples/a2c/cartpole-a2c-microbatch.yaml",
  250. "description": "Runs A2C on the CartPole-v1 environment, using micro-batches.",
  251. },
  252. # A3C
  253. "cartpole-a3c": {
  254. "file": "tuned_examples/a3c/cartpole_a3c.py",
  255. "stop": "{'timesteps_total': 20000, 'episode_reward_mean': 150}",
  256. "description": "Runs A3C on the CartPole-v1 environment.",
  257. },
  258. "pong-a3c": {
  259. "file": "tuned_examples/a3c/pong-a3c.yaml",
  260. "description": "Runs A3C on the ALE/Pong-v5 (deterministic) environment.",
  261. },
  262. # AlphaStar
  263. "multi-agent-cartpole-alpha-star": {
  264. "file": "tuned_examples/alpha_star/multi-agent-cartpole-alpha-star.yaml",
  265. "description": "Runs AlphaStar on 4 CartPole agents.",
  266. },
  267. # AlphaZero
  268. "cartpole-alpha-zero": {
  269. "file": "tuned_examples/alpha_zero/cartpole-sparse-rewards-alpha-zero.yaml",
  270. "description": "Runs AlphaZero on a Cartpole with sparse rewards.",
  271. },
  272. # Apex DDPG
  273. "mountaincar-apex-ddpg": {
  274. "file": "tuned_examples/apex_ddpg/mountaincarcontinuous-apex-ddpg.yaml",
  275. "description": "Runs Apex DDPG on MountainCarContinuous-v0.",
  276. },
  277. "pendulum-apex-ddpg": {
  278. "file": "tuned_examples/apex_ddpg/pendulum-apex-ddpg.yaml",
  279. "description": "Runs Apex DDPG on Pendulum-v1.",
  280. },
  281. # Apex DQN
  282. "breakout-apex-dqn": {
  283. "file": "tuned_examples/apex_dqn/atari-apex-dqn.yaml",
  284. "description": "Runs Apex DQN on ALE/Breakout-v5 (no frameskip).",
  285. },
  286. "cartpole-apex-dqn": {
  287. "file": "tuned_examples/apex_dqn/cartpole-apex-dqn.yaml",
  288. "description": "Runs Apex DQN on CartPole-v1.",
  289. },
  290. "pong-apex-dqn": {
  291. "file": "tuned_examples/apex_dqn/pong-apex-dqn.yaml",
  292. "description": "Runs Apex DQN on ALE/Pong-v5 (no frameskip).",
  293. },
  294. # APPO
  295. "cartpole-appo": {
  296. "file": "tuned_examples/appo/cartpole-appo.yaml",
  297. "description": "Runs APPO on CartPole-v1.",
  298. },
  299. "frozenlake-appo": {
  300. "file": "tuned_examples/appo/frozenlake-appo-vtrace.yaml",
  301. "description": "Runs APPO on FrozenLake-v1.",
  302. },
  303. "halfcheetah-appo": {
  304. "file": "tuned_examples/appo/halfcheetah-appo.yaml",
  305. "description": "Runs APPO on HalfCheetah-v2.",
  306. },
  307. "multi-agent-cartpole-appo": {
  308. "file": "tuned_examples/appo/multi-agent-cartpole-appo.yaml",
  309. "description": "Runs APPO on RLlib's MultiAgentCartPole",
  310. },
  311. "pendulum-appo": {
  312. "file": "tuned_examples/appo/pendulum-appo.yaml",
  313. "description": "Runs APPO on Pendulum-v1.",
  314. },
  315. "pong-appo": {
  316. "file": "tuned_examples/appo/pong-appo.yaml",
  317. "description": "Runs APPO on ALE/Pong-v5 (no frameskip).",
  318. },
  319. # ARS
  320. "cartpole-ars": {
  321. "file": "tuned_examples/ars/cartpole-ars.yaml",
  322. "description": "Runs ARS on CartPole-v1.",
  323. },
  324. "swimmer-ars": {
  325. "file": "tuned_examples/ars/swimmer-ars.yaml",
  326. "description": "Runs ARS on Swimmer-v2.",
  327. },
  328. # Bandits
  329. "recsys-bandits": {
  330. "file": "tuned_examples/bandits/"
  331. + "interest-evolution-recsim-env-bandit-linucb.yaml",
  332. "description": "Runs BanditLinUCB on a Recommendation Simulation environment.",
  333. },
  334. # BC
  335. "cartpole-bc": {
  336. "file": "tuned_examples/bc/cartpole-bc.yaml",
  337. "description": "Runs BC on CartPole-v1.",
  338. },
  339. # CQL
  340. "halfcheetah-cql": {
  341. "file": "tuned_examples/cql/halfcheetah-cql.yaml",
  342. "description": "Runs grid search on HalfCheetah environments with CQL.",
  343. },
  344. "hopper-cql": {
  345. "file": "tuned_examples/cql/hopper-cql.yaml",
  346. "description": "Runs grid search on Hopper environments with CQL.",
  347. },
  348. "pendulum-cql": {
  349. "file": "tuned_examples/cql/pendulum-cql.yaml",
  350. "description": "Runs CQL on Pendulum-v1.",
  351. },
  352. # CRR
  353. "cartpole-crr": {
  354. "file": "tuned_examples/crr/CartPole-v1-crr.yaml",
  355. "description": "Run CRR on CartPole-v1.",
  356. },
  357. "pendulum-crr": {
  358. "file": "tuned_examples/crr/pendulum-v1-crr.yaml",
  359. "description": "Run CRR on Pendulum-v1.",
  360. },
  361. # DDPG
  362. "halfcheetah-ddpg": {
  363. "file": "tuned_examples/ddpg/halfcheetah-ddpg.yaml",
  364. "description": "Runs DDPG on HalfCheetah-v2.",
  365. },
  366. "halfcheetah-bullet-ddpg": {
  367. "file": "tuned_examples/ddpg/halfcheetah-pybullet-ddpg.yaml",
  368. "description": "Runs DDPG on HalfCheetahBulletEnv-v0.",
  369. },
  370. "hopper-bullet-ddpg": {
  371. "file": "tuned_examples/ddpg/hopper-pybullet-ddpg.yaml",
  372. "description": "Runs DDPG on HopperBulletEnv-v0.",
  373. },
  374. "mountaincar-ddpg": {
  375. "file": "tuned_examples/ddpg/mountaincarcontinuous-ddpg.yaml",
  376. "description": "Runs DDPG on MountainCarContinuous-v0.",
  377. },
  378. "pendulum-ddpg": {
  379. "file": "tuned_examples/ddpg/pendulum-ddpg.yaml",
  380. "description": "Runs DDPG on Pendulum-v1.",
  381. },
  382. # DDPPO
  383. "breakout-ddppo": {
  384. "file": "tuned_examples/ddppo/atari-ddppo.yaml",
  385. "description": "Runs DDPPO on ALE/Breakout-v5 (no frameskip).",
  386. },
  387. "cartpole-ddppo": {
  388. "file": "tuned_examples/ddppo/cartpole-ddppo.yaml",
  389. "description": "Runs DDPPO on CartPole-v1",
  390. },
  391. "pendulum-ddppo": {
  392. "file": "tuned_examples/ddppo/pendulum-ddppo.yaml",
  393. "description": "Runs DDPPO on Pendulum-v1.",
  394. },
  395. # DQN
  396. "atari-dqn": {
  397. "file": "tuned_examples/dqn/atari-dqn.yaml",
  398. "description": "Run grid search on Atari environments with DQN.",
  399. },
  400. "atari-duel-ddqn": {
  401. "file": "tuned_examples/dqn/atari-duel-ddqn.yaml",
  402. "description": "Run grid search on Atari environments "
  403. "with duelling double DQN.",
  404. },
  405. "cartpole-dqn": {
  406. "file": "tuned_examples/dqn/cartpole-dqn.yaml",
  407. "description": "Run DQN on CartPole-v1.",
  408. },
  409. "pong-dqn": {
  410. "file": "tuned_examples/dqn/pong-dqn.yaml",
  411. "description": "Run DQN on ALE/Pong-v5 (deterministic).",
  412. },
  413. "pong-rainbow": {
  414. "file": "tuned_examples/dqn/pong-rainbow.yaml",
  415. "description": "Run Rainbow on ALE/Pong-v5 (deterministic).",
  416. },
  417. # DREAMER
  418. "dm-control-dreamer": {
  419. "file": "tuned_examples/dreamer/dreamer-deepmind-control.yaml",
  420. "description": "Run DREAMER on a suite of control problems by Deepmind.",
  421. },
  422. # DT
  423. "cartpole-dt": {
  424. "file": "tuned_examples/dt/CartPole-v1-dt.yaml",
  425. "description": "Run DT on CartPole-v1.",
  426. },
  427. "pendulum-dt": {
  428. "file": "tuned_examples/dt/pendulum-v1-dt.yaml",
  429. "description": "Run DT on Pendulum-v1.",
  430. },
  431. # ES
  432. "cartpole-es": {
  433. "file": "tuned_examples/es/cartpole-es.yaml",
  434. "description": "Run ES on CartPole-v1.",
  435. },
  436. "humanoid-es": {
  437. "file": "tuned_examples/es/humanoid-es.yaml",
  438. "description": "Run ES on Humanoid-v2.",
  439. },
  440. # IMPALA
  441. "atari-impala": {
  442. "file": "tuned_examples/impala/atari-impala.yaml",
  443. "description": "Run grid search over several atari games with IMPALA.",
  444. },
  445. "cartpole-impala": {
  446. "file": "tuned_examples/impala/cartpole-impala.yaml",
  447. "description": "Run IMPALA on CartPole-v1.",
  448. },
  449. "multi-agent-cartpole-impala": {
  450. "file": "tuned_examples/impala/multi-agent-cartpole-impala.yaml",
  451. "description": "Run IMPALA on RLlib's MultiAgentCartPole",
  452. },
  453. "pendulum-impala": {
  454. "file": "tuned_examples/impala/pendulum-impala.yaml",
  455. "description": "Run IMPALA on Pendulum-v1.",
  456. },
  457. "pong-impala": {
  458. "file": "tuned_examples/impala/pong-impala-fast.yaml",
  459. "description": "Run IMPALA on ALE/Pong-v5 (no frameskip).",
  460. },
  461. # MADDPG
  462. "two-step-game-maddpg": {
  463. "file": "tuned_examples/maddpg/two-step-game-maddpg.yaml",
  464. "description": "Run RLlib's Two-step game with multi-agent DDPG.",
  465. },
  466. # MAML
  467. "cartpole-maml": {
  468. "file": "tuned_examples/maml/cartpole-maml.yaml",
  469. "description": "Run MAML on CartPole-v1.",
  470. },
  471. "halfcheetah-maml": {
  472. "file": "tuned_examples/maml/halfcheetah-rand-direc-maml.yaml",
  473. "description": "Run MAML on a custom HalfCheetah environment.",
  474. },
  475. "pendulum-maml": {
  476. "file": "tuned_examples/maml/pendulum-mass-maml.yaml",
  477. "description": "Run MAML on a custom Pendulum environment.",
  478. },
  479. # MARWIL
  480. "cartpole-marwil": {
  481. "file": "tuned_examples/marwil/cartpole-marwil.yaml",
  482. "description": "Run MARWIL on CartPole-v1.",
  483. },
  484. # MBMPO
  485. "cartpole-mbmpo": {
  486. "file": "tuned_examples/mbmpo/cartpole-mbmpo.yaml",
  487. "description": "Run MBMPO on a CartPole environment wrapper.",
  488. },
  489. "halfcheetah-mbmpo": {
  490. "file": "tuned_examples/mbmpo/halfcheetah-mbmpo.yaml",
  491. "description": "Run MBMPO on a HalfCheetah environment wrapper.",
  492. },
  493. "hopper-mbmpo": {
  494. "file": "tuned_examples/mbmpo/hopper-mbmpo.yaml",
  495. "description": "Run MBMPO on a Hopper environment wrapper.",
  496. },
  497. "pendulum-mbmpo": {
  498. "file": "tuned_examples/mbmpo/pendulum-mbmpo.yaml",
  499. "description": "Run MBMPO on a Pendulum environment wrapper.",
  500. },
  501. # PG
  502. "cartpole-pg": {
  503. "file": "tuned_examples/pg/cartpole-pg.yaml",
  504. "description": "Run PG on CartPole-v1",
  505. },
  506. # PPO
  507. "atari-ppo": {
  508. "file": "tuned_examples/ppo/atari-ppo.yaml",
  509. "description": "Run grid search over several atari games with PPO.",
  510. },
  511. "cartpole-ppo": {
  512. "file": "tuned_examples/ppo/cartpole-ppo.yaml",
  513. "description": "Run PPO on CartPole-v1.",
  514. },
  515. "halfcheetah-ppo": {
  516. "file": "tuned_examples/ppo/halfcheetah-ppo.yaml",
  517. "description": "Run PPO on HalfCheetah-v2.",
  518. },
  519. "hopper-ppo": {
  520. "file": "tuned_examples/ppo/hopper-ppo.yaml",
  521. "description": "Run PPO on Hopper-v1.",
  522. },
  523. "humanoid-ppo": {
  524. "file": "tuned_examples/ppo/humanoid-ppo.yaml",
  525. "description": "Run PPO on Humanoid-v1.",
  526. },
  527. "pendulum-ppo": {
  528. "file": "tuned_examples/ppo/pendulum-ppo.yaml",
  529. "description": "Run PPO on Pendulum-v1.",
  530. },
  531. "pong-ppo": {
  532. "file": "tuned_examples/ppo/pong-ppo.yaml",
  533. "description": "Run PPO on ALE/Pong-v5 (no frameskip).",
  534. },
  535. "recsys-ppo": {
  536. "file": "tuned_examples/ppo/recomm-sys001-ppo.yaml",
  537. "description": "Run PPO on a recommender system example from RLlib.",
  538. },
  539. "repeatafterme-ppo": {
  540. "file": "tuned_examples/ppo/repeatafterme-ppo-lstm.yaml",
  541. "description": "Run PPO on RLlib's RepeatAfterMe environment.",
  542. },
  543. "walker2d-ppo": {
  544. "file": "tuned_examples/ppo/walker2d-ppo.yaml",
  545. "description": "Run PPO on the Walker2d-v1 environment.",
  546. },
  547. # QMIX
  548. "two-step-game-qmix": {
  549. "file": "tuned_examples/qmix/two-step-game-qmix.yaml",
  550. "description": "Run QMIX on RLlib's two-step game.",
  551. },
  552. # R2D2
  553. "stateless-cartpole-r2d2": {
  554. "file": "tuned_examples/r2d2/stateless-cartpole-r2d2.yaml",
  555. "description": "Run R2D2 on a stateless cart pole environment.",
  556. },
  557. # SAC
  558. "atari-sac": {
  559. "file": "tuned_examples/sac/atari-sac.yaml",
  560. "description": "Run grid search on several atari games with SAC.",
  561. },
  562. "cartpole-sac": {
  563. "file": "tuned_examples/sac/cartpole-sac.yaml",
  564. "description": "Run SAC on CartPole-v1",
  565. },
  566. "halfcheetah-sac": {
  567. "file": "tuned_examples/sac/halfcheetah-sac.yaml",
  568. "description": "Run SAC on HalfCheetah-v3.",
  569. },
  570. "pacman-sac": {
  571. "file": "tuned_examples/sac/mspacman-sac.yaml",
  572. "description": "Run SAC on ALE/MsPacman-v5 (no frameskip).",
  573. },
  574. "pendulum-sac": {
  575. "file": "tuned_examples/sac/pendulum-sac.yaml",
  576. "description": "Run SAC on Pendulum-v1.",
  577. },
  578. # SimpleQ
  579. "cartpole-simpleq": {
  580. "file": "tuned_examples/simple_q/cartpole-simpleq.yaml",
  581. "description": "Run SimpleQ on CartPole-v1",
  582. },
  583. # SlateQ
  584. "recsys-long-term-slateq": {
  585. "file": "tuned_examples/slateq/long-term-satisfaction-recsim-env-slateq.yaml",
  586. "description": "Run SlateQ on a recommendation system aimed at "
  587. "long-term satisfaction.",
  588. },
  589. "recsys-parametric-slateq": {
  590. "file": "tuned_examples/slateq/parametric-item-reco-env-slateq.yaml",
  591. "description": "SlateQ run on a recommendation system.",
  592. },
  593. "recsys-slateq": {
  594. "file": "tuned_examples/slateq/recomm-sys001-slateq.yaml",
  595. "description": "SlateQ run on a recommendation system.",
  596. },
  597. # TD3
  598. "inverted-pendulum-td3": {
  599. "file": "tuned_examples/td3/invertedpendulum-td3.yaml",
  600. "description": "Run TD3 on InvertedPendulum-v2.",
  601. },
  602. "mujoco-td3": {
  603. "file": "tuned_examples/td3/mujoco-td3.yaml",
  604. "description": "Run TD3 against four of the hardest MuJoCo tasks.",
  605. },
  606. "pendulum-td3": {
  607. "file": "tuned_examples/td3/pendulum-td3.yaml",
  608. "description": "Run TD3 on Pendulum-v1.",
  609. },
  610. }