Skip to content
A pytorch implementation of Relational Networks by Santoro et al (
Jupyter Notebook Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Relational Networks in PyTorch

A PyTorch implementation of Relational Networks by Santoro et al (

Santoro, A., Raposo, D., Barrett, D. G., Malinowski, M., Pascanu, R., Battaglia, P., & Lillicrap, T. (2017). A simple neural network module for relational reasoning. In Advances in neural information processing systems (pp. 4967-4976).

For evaluation purposes we use an existing version of the Sort-Of-CLEVR dataset, available through kaggle. This dataset contains of 10000 images with questions encoded in vectors.


After cloneing this repository you can either use your own pytorch environment or use the following simple setup script for a new environment:

$ make create_environment
$ source activate pytorch_p27
$ make requirements


The data was acquired from You can either download it there and copy it to data/ or use the make load_data command if you have the kaggle CLI set-up.


You can directly use the src/ file and the commands specified there or start the scripts with make train and make train_mlp for the two network variants.

make train_lstm is also provided to run the same architecture but without the pre-encoded questions. To run the CNN+MLP version with lstm please manually run (python -m src.main --mlp --lstm).

You can’t perform that action at this time.