Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.
/ value-rnn-beliefs Public archive

Code for fitting models and generating plots in the paper "Emergence of belief-like representations through reinforcement learning" by Hennig et al. (2023)

Notifications You must be signed in to change notification settings

mobeets/value-rnn-beliefs

Repository files navigation

Installation

First, clone this repo. Next, you will also need to pull the valuernn submodule by running:

git submodule update --init

Next, set up the required python packages by creating a virtual environment:

conda create --name valuernn python=3.9 pytorch matplotlib numpy scipy scikit-learn
conda activate valuernn

Train models

Option 1. To use the models from the paper, unzip data/models.zip to the folder data/models.

Option 2. To fit your own models (approximate run time: 48 hours), run:

chmod +x bin/fit.sh
./bin/fit.sh

Analyze models

Option 1. To use the analyses from the paper, unzip data/sessions.zip to the folder data/sessions.

Option 2. To analyze your own models, run:

chmod +x bin/analyze.sh
./bin/analyze.sh

Make figures

To make the figures, run:

chmod +x bin/plot.sh
./bin/plot.sh

The resulting figures will be in data/figures/.

(Note: If you encounter an error on Mac regarding libomp.dylib, try conda install nomkl.)

About

Code for fitting models and generating plots in the paper "Emergence of belief-like representations through reinforcement learning" by Hennig et al. (2023)

Resources

Stars

Watchers

Forks