Code Monkey home page Code Monkey logo

dense-coattention-network's Introduction

Improved Fusion of Visual and Language Representations by Dense Symmetric Co-Attention for Visual Question Answering

If you make use of this code, please cite the following paper (and give us a star ^_^):

@article{DBLP:journals/corr/abs-1804-00775,
  author    = {Duy{-}Kien Nguyen and Takayuki Okatani},
  title     = {Improved Fusion of Visual and Language Representations by Dense Symmetric Co-Attention for Visual Question Answering},
  journal   = {CoRR},
  volume    = {abs/1804.00775},
  year      = {2018},
  url       = {http://arxiv.org/abs/1804.00775}
}

Overview

This repository contains Pytorch implementation of "Improved Fusion of Visual and Language Representations by Dense Symmetric Co-Attention for Visual Question Answering" paper. The network architecture is illustrated in Figure 1.

Figure 1: Overview of Dense Co-Attention Network architecture.

Figure 1: The Dense Co-Attention Network architecture.

Files

├──vqa_eval/ - Evaluation code provided from VQA team
├──preprocess/ - Preprocessing code before training the network
├──dense_coattn/ - Dense Co-Attention code
train.py - Train the model
answer.py - Generate the answer for test dataset
ensemble.py - Ensemble multiple results from different models
vqa_eval.py - Evaluate the performance of model (Provided by VQA team)

Dependencies

Tests are performed with following version of libraries:

  • Python 3.6.3
  • Numpy 1.13.3
  • Pytorch 0.3.1
  • Torchtext (for Pytorch 0.3)
  • Tensorflow (if you want to use tensorboard visualization)

Training from Scratch

The dataset can be downloaded from: http://visualqa.org/.

We provide the scripts for training our network from scratch by simply running the train.py script to train the model.

  • All of arguments are described in the train.py file so that you can easily change the hyper-parameter and training conditions (Most of the default hyper-parameters are used in the main paper).
  • Pretrained GloVe word embedding is loaded from torchtext (torchtext for Pytorch 0.3)

Evaluation

Run answer.py file to generate all of answers for the test set. You can use ensemble.py to ensemble multiple model's results for the evaluation

License

The source code is licensed under GNU General Public License v3.0.

dense-coattention-network's People

Contributors

kienduynguyen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.