As discussed, an NTM is composed of two important components:
- A neural network, also known as the controller
- A two-dimensional matrix called memory
In this tutorial, we will implement a simplistic version of both and try to showcase the copy tasks.
The task objective is as follows:
- The NTM model is shown a random k-dimensional vector for T time steps.
- The job of the network is to output these T k-dimensional random vectors from zero vectors at each time step.
Perform the following steps to implement NTMs:
- First, import all the required libraries:
import torchfrom torch import nnimport torch.nn.functional as Fimport numpy as npfrom time import timeimport torchvision.utils as vutilsfrom torch.utils.data import Dataset ...