项目
在 GitHub 查看
henry9zhr/QANet-pytorch
关于
A PyTorch implementation of QANet.
其他项目实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文QANet-pytorch
NOTICE
I'm very busy these months. I'll return to this repo in about 10 days.
Introduction
An implementation of QANet with PyTorch.
Any contributions are welcome!
Current performance
| F1 | EM | Got by |
|---|---|---|
| 66 | ? | InitialBug |
| 64 | 50 | BangLiu |
Usage
- Install pytorch 0.4 for Python 3.6+
- Run
pip install -r requirements.txtto install python dependencies. - Run
download.shto download the dataset. - Run
python preproc.pyto build tensors from the raw dataset. - Run
python main.py --mode trainto train the model. After training,log/model.ptwill be generated. - Run
python main.py --mode testto test an pretrained model. Default model file islog/model.pt
Structure
preproc.py: downloads dataset and builds input tensors.
main.py: program entry; functions about training and testing.
models.py: QANet structure.
config.py: configurations.
Differences from the paper
- The paper doesn't mention which activation function they used. I use relu.
- I don't set the embedding of
<UNK>trainable. - 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 implemented it.
TODO
- Reduce memory usage
- Improve converging speed (to reach 60 F1 scores in 1000 iterations)
- Reach state-of-art scroes of the original paper
- Performance analysis
- Test on SQuAD 2.0
Contributors
- InitialBug: found two bugs: (1) positional encodings require gradients; (2) wrong weight sharing among encoders.
- linthieda: fixed one issue about dependencies and offered computing resources.
- BangLiu: tested the model.
- wlhgtc: (1) improved the calculation of Context-Question Attention; (2) fixed a bug that is compacting embeddings before highway nets.
探索相关项目
加载中…