Skip to content
项目

andreamad8/Universal-Transformer-Pytorch

在 GitHub 查看

关于

Implementation of Universal Transformer in Pytorch

人工智能与机器学习

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Universal-Transformer-Pytorch

Simple and self-contained implementation of the Universal Transformer (Dehghani, 2018) in Pytorch. Please open issues if you find bugs, and send pull request if you want to contribuite.

GIF taken from: https://twitter.com/OriolVinyalsML/status/1017523208059260929

Universal Transformer

The basic Transformer model has been taken from https://github.com/kolloldas/torchnlp. For now it has been implemented:

  • Universal Transformer Encoder Decoder, with position and time embeddings.
  • Adaptive Computation Time (Graves, 2016) as describe in Universal Transformer paper.
  • Universal Transformer for bAbI data.

Dependendency

python3
pytorch 0.4
torchtext
argparse

How to run

To run standard Universal Transformer on bAbI run:

python main.py --task 1

To run Adaptive Computation Time:

python main.py --task 1 --act

Results

10k over 10 run, get the maximum.

In task 16 17 18 19 I notice that are very hard to converge also in training set. The problem seams to be the lr rate scheduling. Moreover, on 1K setting the results are very bad yet, maybe I have to tune some hyper-parameters.

Task Uni-Trs + ACT Original
1 0.0 0.0 0.0
2 0.0 0.2 0.0
3 0.8 2.4 0.4
4 0.0 0.0 0.0
5 0.4 0.1 0.0
6 0.0 0.0 0.0
7 0.4 0.0 0.0
8 0.2 0.1 0.0
9 0.0 0.0 0.0
10 0.0 0.0 0.0
11 0.0 0.0 0.0
12 0.0 0.0 0.0
13 0.0 0.0 0.0
14 0.0 0.0 0.0
15 0.0 0.0 0.0
16 50.5 50.6 0.4
17 13.7 14.1 0.6
18 4 6.9 0.0
19 79.2 65.2 2.8
20 0.0 0.0 0.0
--- --- --- ---
avg 7.46 6.98 0.21
fail 3 3 0

TODO

  • Visualize ACT on different tasks

探索相关项目

加载中…