The project enables economists to simulate how human frictions influence responses to monetary policy. The Gym-style environment reflects classic macro-economic model with human agents representing households. The agents can learn to respond optimally with simple heuristics or deep reinforcement learning (e.g. with rllib).
Before you begin, ensure you have met the following requirements:
Linux/Mac
machine.docker
installed.To start, run this line in human-friction dir:
docker build -t human-friction:1.0 .
It will build docker image, used for running other commands. You can execute scripts using Docker. Docker must be build to reflect changes.
docker run human-friction:1.0
To start development, edit files in your editor. You can execute scripts using Docker. Docker must be build to reflect changes.
docker run human-friction:1.0
python3 -m venv venv
. venv/bin/activate
pip3 install --upgrade pip setuptools wheel
pip3 install -e .
pip3 install -r requirements.txt
Then you can run a training script from command line, e.g.:
python3 train.py
Make sure that code style follows our guidlines by installing pre-commit: Using pip:
pip install pre-commit
Using homebrew:
brew install pre-commit
Then run
pre-commit install
to set up the git hook scripts.
If you need an additional package in docker, add it to requirements.in
and run script ./scripts/run-refresh-requirements
.
It will refresh requirements.txt
file, based on content of requirements.in
.
When finished, you have to rebuild your docker image to include new packages
using docker build -t human-friction:1.0 .
command.
You also have to do it if someone else updated
requirements.txt
and you pulled it from remote repository.
To use human-friction, train and evaluate the agents, an example is provided in train.py
and evaluate.py
.
To contribute to human-frictions, follow these steps:
git checkout -b <branch_name>
.git commit -m '<commit_message>'
git push origin
Alternatively see the GitHub documentation on creating a pull request.
We are using pytest`for tests. You can run them via:
pytest
Thanks to the following people who have contributed to this project:
If you want to contact me you can reach me at matthias.hettich@tu-berlin.de.
This project uses the following license: MIT License.