Week 4, Visualizing LSTM Models

Hello, Given X as the input window steps, Y as the output window steps, and we have 2 LSTM layers with C1 cells in the first LSTM layer and C2 cells in the second LSTM layer.

  1. Can you please show me a drawing/sketch of how this model is illustrated?
  2. And what if we replaced the LSTM layers with Bidirectional LSTM layers, How can that be illustrated visually?
  3. Why the number of cells in the LSTM layer doesn’t match the number of input steps?
    Let’s say we have sequences of data with an input window of 7 steps and an output window of 3 steps. And we initialized 2 LSTM layers with 32 cells each.
    From the attached picture, the number of cells should be the same as the number of steps in the input window(num cells = 7), right?

Dear @Mohamed_Nedal, I am not able to get it clearly from where have you picked this image but there’s a whole proper lecture on LSTM models in DLS-Course 5 (Sequence Models) if you would you want to learn and understand it’s basics, different models and their workings.

Well, to make you understand on how LSTM works, here’s an illustration.

The first cell is the forget gate followed by the input gate(2nd cell) and the last third one is the output gate. Like RNN, LSTM also has a hidden state. The H(t-1) represents the hidden state of the previous timestamp whereas H(t) represents the current timestamp. The cell state is represented by Previous timestamp C(t-1) and current timestamp C(t). The Hidden state, here, is known as Short-term Memory whereas Cell state is recognised as Long-Term Memory.

LSTM-GIF

Well, this explanation won’t be enough for you, I know, but unless I understand where actually have you got this image from, I won’t be able to help you out. Thanks :slight_smile: