https://github.com/rosinality/mac-network-pytorch
Memory, Attention and Composition (MAC) Network for CLEVR implemented in PyTorch
https://github.com/rosinality/mac-network-pytorch
Last synced: about 1 month ago
JSON representation
Memory, Attention and Composition (MAC) Network for CLEVR implemented in PyTorch
- Host: GitHub
- URL: https://github.com/rosinality/mac-network-pytorch
- Owner: rosinality
- License: mit
- Created: 2018-04-21T08:01:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-05T23:58:18.000Z (over 6 years ago)
- Last Synced: 2025-04-28T13:09:11.601Z (about 1 month ago)
- Language: Python
- Size: 13.7 KB
- Stars: 85
- Watchers: 3
- Forks: 24
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mac-network-pytorch
Memory, Attention and Composition (MAC) Network for CLEVR from Compositional Attention Networks for Machine Reasoning (https://arxiv.org/abs/1803.03067) implemented in PyTorchRequirements:
* Python 3.6
* PyTorch 0.4
* torch-vision
* Pillow
* nltk
* tqdmTo train:
1. Download and extract CLEVR v1.0 dataset from http://cs.stanford.edu/people/jcjohns/clevr/
2. Preprocessing question data and extracting image features using ResNet 101
```
python preprocess.py [CLEVR directory]
python image_feature.py [CLEVR directory]
```
!CAUTION! the size of file created by image_feature.py is very large! (~70 GiB) You may use hdf5 compression, but it will slow down feature extraction.3. Run train.py
```
python train.py [CLEVR directory]
```This implementation produces 95.75% accuracy at epoch 10, 96.5% accuracy at epoch 20.