This repository provides an implementation of the simulation experiments in the paper "Superposition mechanism as a neural basis for understanding others" by Wataru Noguchi, Hiroyuki Iizuka, Masahito Yamamoto, and Shigeru Taguchi.
All the datasets and results of the paper can be reproduced by the codes in this repository.
To reproduce the results, please setup the following dependencies. Or container environment of singularity can be used (see below).
The codes were tested on the system with ...
- Ubuntu 20.04
- Python 3.8
- CUDA 11.4
Although not tested, the code can be run on systems with different versions of software.
Install using apt.
$ sudo apt install imagemagick libopencv-dev
Python package dependencies can be installed by using pip.
$ pip install -r requirements.txt
All the results on the paper can be reproduced by running following script.
$ ./run_all.sh
The results of analyses can be found the locations listed on docs/results_locations.md.
The above script excecute following scripts for the data collection, trainings, and analyses.
First, collect datasets used for the training of the network.
$ ./run_collect_data.sh
Then, perform all the trainings explained in the paper.
$ ./run_training.sh
The training logs and trained network parameters will be saved under the directory data/result
Finally, perform the analysis on the trained networks.
$ ./run_analysis.sh exp1
$ ./run_analysis_exp2.sh
$ ./run_analysis.sh exp3
$ ./run_regression.sh
We provide a definition file for singularity container environment (https://sylabs.io/singularity). CUDA still need to be installed outside the container.
- Install singularity following the documentation (https://sylabs.io/docs).
- Build the container.
$ singularity build --fakeroot --sandbox env/ singularity.def
- Enter the container.
$ singularity shell --fakeroot --nv env
- Then, run commands.
Singularity> ./run_all.sh