Overview

This section explains the modular design of ArrayLSTM on a high level. Figure 1 provides an overview of the different modules used in the ArrayLSTM implementation.

../_images/class_diagram.png

Figure 1: Overview of modules in class diagram. Note that this diagram only contains attributes and methods that are overwritten in the respective classes.

All LSTM variants are subclasses of the nn.Module class. Therefore, they all implement the forward(X, hidden) method. Or alternatively, the class implements the __call__() method, which subsequently calls the forward(X, hidden) method. Figure 2 gives an overview of how the forward method is implemented. Note that the dashed block update_hidden() is only called in the ArrayLSTM variants, not the regular LSTM.

../_images/flow_chart.png

Figure 2: Control flow graph of methods called for each sequence. Note that the update_hidden() method is only called in the ArrayLSTM variants, not the regular LSTM.