- Python 3.8
- Poetry 1.1
- graphviz (optional)
- manim (optional)
-
Download & install the latest python 3.8 release from here
-
Download and install poetry as explained here
-
Optional: Install graphviz
Mac: brew install graphviz Windows: choco install graphviz
4.1. Optional: Install manim dependencies as described here
4.2. Optional: Run poetry add manimce==0.1
to add manim to poetry
-
Run
poetry install
in the root of the repository to create a virtual environment and install the required dependencies -
Run one of the run scripts ...
6.1. ... using the command line
poetry shell poetry run python rl/main_dataset.py poetry run python rl/main.py poetry run python supervised/main.py
6.2. ... through an IDE:
- Select the poetry venv as interpreter & run one of the run scripts
If Graphviz is installed, the architecture images can be generated by using
the save_model_architecture_images()
method that is implemented in Network and its inheriting classes
(e.g. NetworkRL and NetworkSupervised)
Manim is required to use the RLScene class script in animation/network_scene
.
If it is set up, a video file can be generated by running
manim animation/network_scene.py RLScene -p -qp
More information about manim can be found here
- animates the training process of the Reinforcement Learner
- not designed to be too generic
- might need adjustments when changing parameters
Black is used to ensure a consistent code style. Additionally, a
pre-commit hook is configured and can be activated by running pre-commit install
If it is activated, the code is analyzed during a commit. If adjustments are necessary, the following happens:
- the commit fails
- the code gets automatically adjusted according to the Black style guide
The changes then need to be re-added and committed again.
This section lists problems encountered during the work and the required steps to resolve them
Occurred on macOS. Can be fixed when running the following command to install necessary certificates:
/Applications/Python 3.8/Install Certificates.command
-
All run scripts are designed to be invoked from the root directory! (e.g. running
main_dataset.py
from within the rl folder does not work) -
The main scripts in the experiment branches were invoked via PyCharm and likely fail to run when invoked from the command line because the repository root folder is not in the pythonpath. This can be addressed by adding the following lines on top of the run scripts.
import sys import os sys.path.insert(0, os.getcwd())
Those lines are already included for all run scripts on the master branch.