Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

MDP Playground integration into bsuite #38

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,133 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Virtual environment files.
bin/
lib/
Expand Down
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@ All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

## Process to add new experiments in BSuite:
1. If you're creating a completely new environment, create a directory in `bsuite/environments` with: `<env>.py`. `<env>.py` should define a new env_class which should be a subclass of `bsuite.environments.base.Environment` (and it should return appropriate info in `bsuite_info()`).

1. Create directory in `bsuite/experiments` with: `<exp>.py`, `sweep.py`, `analysis.py`, `__init__.py`, `<exp>_test.py`.
* `<exp>.py`: Needs to import the environment used for the experiment that is defined in `bsuite/environments/`
* `<env>.py` and define a load variable in the file that is equal to `<env_class`, i.e., `load = <env>.<env_class>`
* `sweep.py`: Needs to have the parameters that vary for the experiment. e.g., `seed` and `noise_scale` for `cartpole_noise`. Each set of parameters is stored as a dict in a tuple named `SETTINGS`. This file also defines `NUM_EPISODES` and `TAGS` (such as `credit_assignment`, `basic`, `exploration`, etc.). In `TAGS`, the 1st tag should be one of the basic "types" from `summary_analysis.py`: `['basic', 'noise', 'scale', 'exploration', 'credit_assignment', 'memory', 'mdp_playground']`. NOTE: Remember to add a comma after the tag in `TAGS` if there is only 1 tag, because the comma is what makes it a tuple in Python.
* `analysis.py`: Needs to define `score()`, `plot_learning()`, `plot_seeds()` (and possibly other functions like `plot_average`) that will be used by `bsuite/analysis/results.ipynb` to analyse and plot recorded data.

1. `bsuite/bsuite.py`, `bsuite/sweep.py`, `bsuite/experiments/summary_analysis.py` and `bsuite/analysis/results.ipynb` need to be modified for each new experiment added. We need to add code lines specific to the new experiment, e.g., `from bsuite.experiments.<exp> import ...`.
Loading