README.md 1.59 KB
Newer Older
Lukasz Kaiser's avatar
Lukasz Kaiser committed
1
2
3
4
# NeuralGPU
Code for the Neural GPU model as described
in [[http://arxiv.org/abs/1511.08228]].

5
6
7
8
Requirements:
* TensorFlow (see tensorflow.org for how to install)
* Matplotlib for Python (sudo apt-get install python-matplotlib)

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
The model can be trained on the following algorithmic tasks:

* `sort` - Sort a decimal list
* `kvsort` - Sort decimal keys in dictionary
* `id` - Return the same decimal list
* `rev` - Reverse a decimal list
* `rev2` - Reverse a decimal dictionary by key
* `incr` - Add one to a decimal
* `add` - Long decimal addition
* `left` - First decimal in list
* `right` - Last decimal in list
* `left-shift` - Left shift a decimal list
* `right-shift` - Right shift a decimal list
* `bmul` - Long binary multiplication
* `mul` - Long decimal multiplication
* `dup` - Duplicate a decimal list with padding
* `badd` - Long binary addition
* `qadd` - Long quaternary addition
* `search` - Search for decimal key in dictionary

To train the model on the reverse task run:

```
python neural_gpu_trainer.py --task=rev
```

While training, interim / checkpoint model parameters will be
written to `/tmp/neural_gpu/`.

Once the amount of error gets down to what you're comfortable
with, hit `Ctrl-C` to stop the training process. The latest
model parameters will be in `/tmp/neural_gpu/neural_gpu.ckpt-<step>`
and used on any subsequent run.

To test a trained model on how well it decodes run:

```
python neural_gpu_trainer.py --task=rev --mode=1
```

To produce an animation of the result run:

```
python neural_gpu_trainer.py --task=rev --mode=1 --animate=True
```
54

55
Maintained by Lukasz Kaiser (lukaszkaiser)