README.md 2.4 KB
Newer Older
S
Shaojie Bai 已提交
1
# Sequence Modeling Benchmarks and Temporal Convolutional Networks (TCN)
S
Shaojie Bai 已提交
2 3


S
Shaojie Bai 已提交
4
This repository contains the experiments done in the work [An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling](https://arxiv.org/abs/1803.01271) by Shaojie Bai, J. Zico Kolter and Vladlen Koltun.
S
Shaojie Bai 已提交
5 6 7

We specifically target a comprehensive set of tasks that have been repeatedly used to compare the effectiveness of different recurrent networks, and evaluate a simple, generic but powerful (purely) convolutional network on the recurrent nets' home turf.

8 9 10
Experiments are done in PyTorch. If you find this repository helpful, please cite our work:

```
S
Shaojie Bai 已提交
11
@article{BaiTCN2018,
12 13
	author    = {Shaojie Bai and J. Zico Kolter and Vladlen Koltun},
	title     = {An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling},
S
Shaojie Bai 已提交
14
	journal   = {arXiv:1803.01271},
15 16 17
	year      = {2018},
}
```
S
Shaojie Bai 已提交
18 19 20

## Domains and Datasets

21
**Update**: The code should be directly runnable with PyTorch v1.0.0 or above (PyTorch v>1.3.0 strongly recommended). The older versions of PyTorch are no longer supported.
S
Shaojie Bai 已提交
22

S
Shaojie Bai 已提交
23 24 25 26 27 28 29 30 31 32 33 34 35 36
This repository contains the benchmarks to the following tasks, with details explained in each sub-directory:

  - **The Adding Problem** with various T (we evaluated on T=200, 400, 600)
  - **Copying Memory Task** with various T (we evaluated on T=500, 1000, 2000)
  - **Sequential MNIST** digit classification
  - **Permuted Sequential MNIST** (based on Seq. MNIST, but more challenging)
  - **JSB Chorales** polyphonic music
  - **Nottingham** polyphonic music
  - **PennTreebank** [SMALL] word-level language modeling (LM)
  - **Wikitext-103** [LARGE] word-level LM
  - **LAMBADA** [LARGE] word-level LM and textual understanding
  - **PennTreebank** [MEDIUM] char-level LM
  - **text8** [LARGE] char-level LM

S
Shaojie Bai 已提交
37
While some of the large datasets are not included in this repo, we use the [observations](https://github.com/edwardlib/observations) package to download them, which can be easily installed using pip. 
S
Shaojie Bai 已提交
38 39 40 41 42 43 44 45 46 47 48 49 50 51

## Usage

Each task is contained in its own directory, with the following structure:

```
[TASK_NAME] /
    data/
    [TASK_NAME]_test.py
    models.py
    utils.py
```

To run TCN model on the task, one only need to run `[TASK_NAME]_test.py` (e.g. `add_test.py`). To tune the hyperparameters, one can specify via argument options, which can been seen via the `-h` flag.