PyTorch Port of DeepMind's Differentiable Neural Computer
Go to file
2022-08-23 09:13:25 -04:00
dnc Initial commit 2022-08-23 21:58:43 +09:00
tests Initial commit 2022-08-23 21:58:43 +09:00
.gitignore Initial commit 2022-08-23 05:33:24 -04:00
LICENSE Initial commit 2022-08-23 05:33:24 -04:00
README.md Update README.md 2022-08-23 09:13:25 -04:00
requirements.txt Initial commit 2022-08-23 21:58:43 +09:00
train.py Initial commit 2022-08-23 21:58:43 +09:00

Differentiable Neural Computer in PyTorch

This is PyTorch port of DeepMind's Differentiable Neural Computer (DNC).

The original code was written with TensorFlow v1, which is not straightforward to set up in modern tech stack, such as Apple Scilicon and Python 3.8+.

This code requires only PyTorch >= 1.10.

The code structure and interfaces are kept almost same. The original docstring is preserved as-is.

Usage

Training

You can run repeat-copy task with python train.py. It will start the training of DNC with repeat-copy task, and generates output like the following.

For the format of the display, please checkout the docstring of RepeatCopy class.

2022-08-23 22:05:58,750: 18499: Avg training loss 2.1131072425842286
2022-08-23 22:05:58,750:
Observations:
+- 1 - - - - - - -+
+- - 1 - - - - - -+
+- 1 - - - - - - -+
+- 1 1 - - - - - -+
+1 - - - - - - - -+
+- - - 1 - - - - -+

Targets:
+- - - - 1 - - - -+
+- - - - - 1 - - -+
+- - - - 1 - - - -+
+- - - - 1 1 - - -+
+- - - - - - 1 - -+

Model Output:
+- - - - 1 - - - -+
+- - - - 1 - - - -+
+- - - - 1 - - - -+
+- - - - 1 1 - - -+
+- - - - - - 1 - -+

Unit tests

Unit tests are also ported. Run pytest tests.