Giter Site home page Giter Site logo

qanet-pytorch's Introduction

QANet-pytorch

NOTICE

This repo is under re-implementation. Due to frequent modification, this code may not run normally.

Introduction

An implementation of QANet with PyTorch.

Now it can reach EM/F1 = 70.5/77.2 after 20 epoches for about 20 hours on one 1080Ti card.

Usage

Python 3.6 & PyTorch 0.4

  1. Install pytorch 0.4 for Python 3.6+
  2. Run pip install spacy tqdm ujson requests
  3. Run python -m spacy download en
  4. Run python main.py

Structure

dataset.py: download dataset and parse.

main.py: program entry.

models.py: QANet structure.

Differences from the paper

  1. The paper doesn't mention which activation function they used. I use relu.
  2. I don't set the embedding of <UNK> trainable.
  3. The connector between embedding layers and embedding encoders may be different from the implementation of Google, since the description in the paper is inconsistent (residual block can't be used because the dimensions of input and output are different) and they don't say how they implement it.
  4. Max passage length is 300 instead of 400 since I don't have much GPU memory.

TODO

  • Reduce memory usage
  • Performance analysis
  • Reach state-of-art scroes of the original paper
  • Ablation analysis

qanet-pytorch's People

Contributors

hengruo avatar

Watchers

Casillas 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.