Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Nov 16, 2024
1 parent ae983ed commit feef4f5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Pokemon Red (RL Edition)

![Tests](https://github.com/thatguy11325/pokemonred_puffer/actions/workflows/workflow.yml/badge.svg)

This repo is designed as a library to be used for Pokemon Red RL development. It contains some convenience functions that should not be used in a library setting and should be forked. In the future, those convenience functions will be migrated so no forking is needed.

## Quickstart
Expand All @@ -19,17 +21,37 @@ pip3 install -e .

### Running

After installation you can start training by running
Below are commands that use default arguments in some cases. Please run `python3 -m pokemonred_puffer.train --help` if you are unsure how to use the commandline actions associated with this repo. Some commands may not have been tested recently so please make an issue if you have one.

After installation you can start training by running:

```sh
# Run before training to test what num_envs value you should use
python3 -m pokemonred_puffer.train --mode autotune --yaml config.yaml --vectorization multiprocessing -w empty -r baseline.CutWithObjectRewardRequiredEventsEnv
python3 -m pokemonred_puffer.train autotune
# Default
python3 -m pokemonred_puffer.train --mode train --yaml config.yaml
# Currently used configuration
python3 -m pokemonred_puffer.train --mode train --yaml config.yaml --vectorization multiprocessing -w stream_only -r baseline.CutWithObjectRewardRequiredEventsEnv
python3 -m pokemonred_puffer.train train
```

### Multinode Hyperparameter Sweeps (in progress)

If you want to run hyperparameter sweeps, you can do so by installing related packages and launching two commands:

```sh
pip3 install -e '.[sweep]'
python3 -m pokemonred_puffer.sweep launch-sweep
python3 -m pokemonred_puffer.sweep launch-agent <sweep-id>
```

The sweep id will be printed when launching the sweep. To resume a sweep, you can relaunch your sweep with

```sh
python3 -m pokemonred_puffer.sweep launch-sweep --sweep-id <sweep-id>
```

The sweeps can be configured with a sweep configuration (defaulted to `sweep-config.yaml`) and base configuration (defaulted to `config.yaml`). The hyperparamter sweep sets bounds using the sweep config and centers the hyperparamters at paramters in the base config. To learn more about the hyperparamter algorithm, you can visit [Imbue's CARBS repo](https://github.com/imbue-ai/carbs/tree/main).

N.B. Currently single node sweeps are not supported. If this is a desired feature, please make an issue.

### Modifying for Training

So you have a run going, but you want to mess with it, what do you do?
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ classifiers = [
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
]
dependencies = [
Expand All @@ -27,6 +29,7 @@ dependencies = [
"wandb",
"websockets"
]
requires-python = ">= 3.10"

[tool.setuptools.packages.find]
where = ["."]
Expand Down

0 comments on commit feef4f5

Please sign in to comment.