Implementation of a Neural Turing Machine (NTM) using Tensor Flow (v0.8)
Original Paper: http://arxiv.org/abs/1410.5401
-
Clone TensorFlow (v0.8) into the root folder of this project. You can find a link to the github repo at https://www.tensorflow.org/. Follow the instructions to build and install it. You should build from source because we use a custom user op implemented in C++.
-
In the folder
rotate_op/
you will find three files:BUILD
,rotate.cc
androtate_grad.cc
. These are user operations that we wrote. Copy them intotensorflow/tensorflow/core/user_ops
. Then run the following commandbazel build -c opt //tensorflow/core/user_ops:rotate.so
in that directory. This generates the.so
file that will be loaded byntm.py
. If you did not clone tensorflow into the root folder of this project as instructed, please modify the path inntm.py
accordingly. -
To execute the copy task, run
python copy_task.py
.
Checkpoint files are automatically saved by copy_task.py
every 1000 training iterations.
You can reload a saved model and run it with custom inputs using analyze.py
.
You might have to make some changes specific to your experiment.
You will find the accompanying final report in the report/
folder. It uses some images from the
images/
folder. Print statements along with parse.py
were used to log
some of the internal state of the NTM, like the read and write head positions that we show in the
report.
You will find all the NTM specific code in ntm.py
. The boilerplate/experiment-harness code for
the copy task can be found in copy_task.py
. Files prefixed with test_
are small test scripts.
Most of them just check if the code runs without crashing. The experiment code
for the context-free parenthesis language experiment can be found in dyck_task.py
.
Unfortunately due to lack of time we were unable to write it up.
http://awawfumin.blogspot.com/2015/03/neural-turing-machines-implementation.html
https://blog.wtf.sg/2015/01/15/neural-turing-machines-faq/#more-843