This is the official repository for "Explanatory Learning: Beyond Empiricism in Neural Networks" [arXiv][PDF].
Download the datasets with the following links:
After downloading, move the datasets inside the directory data
, located in the repository root folder.
First, clone the github repository
git clone https://github.com/gladia-research-group/explanatory-learning.git
and move the current directory int the repository root:
cd explanatory-learning
This repository has the following dependencies:
- Python 3.8
- PyTorch 1.7 (look here)
All other dependencies can be easily installed by running:
pip install -r requirements.txt
It is possible to train the models described in the paper with the following commands. First, while inside the root directory, you can start the training procedure for the models described in the paper with the following command:
python explanatory_learning/learning/training.py --config-file "config.json"
This will create a folder in the repository root directory named training_results
. This folder is necessary in order to run the experiments in the paper.
NOTE: It is possible to change the configuration file config.json
(located in the repository root folder) to modify the training procedure.
In order to execute the experiments reported in the paper you can use the following commands.
- Rule Induction Task: For the results presented in Table 1, run:
python explanatory_learning/experiments/rule_induction.py --config-file "configs/config.json"
- World Labeling Task: For the results presented in Table 2, run:
python explanatory_learning/experiments/world_labeling.py --config-file "configs/config.json"
- Rank Analysis: For the results presented in Table 3, run:
python explanatory_learning/experiments/rank_analysis.py --config-file "configs/config.json"
- Interpreter Evaluation: For the results presented in Figure 4, run:
python explanatory_learning/experiments/interpreter_analysis.py --config-file "configs/config.json"
NOTE: Each command will generate a respective folder in the repository root directory containing the results in json format. In particular, the file
python explanatory_learning/experiments/<X>.py --config-file "configs/config.json"
will generate the directory <X>_results
.