Cartpole agents and environments for real-world RL.
go build cmd/experiment/main.go
This provides a slight speedup over usinggo run
in the next step (about 3 seconds per run).time parallel './main -config "config/esarsa.json" -run' ::: {1..60}
This runs 60 experiments in parallel. They'll all use the defaultsweep=0
, but a different run number. Note this uses GNU Parallel.- Change
config/esarsa.json
to a different config as necessary. (As much as possible it's good to run experiments based on versions of a config that have been committed. Then we have a history and can re-run previous versions.)
- Make sure you're in the virtualenv:
source env/bin/activate
. - If you haven't yet done so, install Jupyter from the pip file:
pip install -r requirements.txt
. - Launch Jupyter:
jupyter notebook --notebook-dir="plot"
. (The argument isn't necessary. It just opens the plot folder directly.)
- Execute
source env/bin/activate
(or.\env\Scripts\activate
on Windows) to enter the virtual environment. - Change into the Experiments directory:
cd python/Experiments/
. The control script currently only works from that directory. Then run the code withpython control.py
. Parameters can be changed by providing a different parameters JSON file. - If you need a new package, install it in the virtual environment with
python -m pip install PACKAGE_NAME
and add it to the requirements withpip freeze > requirements.txt
. - When you're done working on the project,
deactivate
exits the virtual environment.
- Run
python3 -m venv env
(orpy -m venv env
on Windows). This will create the virtual environment. This only needs to be done once. - Execute
source env/bin/activate
(or.\env\Scripts\activate
on Windows) to enter the virtual environment. - Execute
pip install --upgrade pip
to upgrade pip. - Execute
pip install -r requirements.txt
to install required packages. - Execute
deactivate
to exit the virtual environment.
This is only necessary if you need to modify the protocol buffer definitions (which is unlikely).
- Install protocol buffers. I downloaded the C++ code and compiled from source. These instructions might work for you: https://github.com/protocolbuffers/protobuf/blob/master/src/README.md
- Install the go plugin:
go get -u github.com/golang/protobuf/protoc-gen-go
- From within an active
virtualenv
session, install the python plugin:python -m pip install grpcio
- Now you can execute
lib/remote/generate.sh