common.py 26 KB

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