Need help with djmodel (Improvise_a_Jazz_Solo_with_an_LSTM_Network_v4)

I am stuck with the implementation of djmodel . Specifically, at # Step 2.A: select the "t"th time step vector from X. , even though I am picking the "t"th timestep, its dimension is (None, 90) and not (n_values) as described in the hint. Next, when I use the reshaper, it becomes of shape : (None, 1, 90), and not (1,90) as per the hint. Then, I get stuck on the call to LSTM_cell.

What am I doing wrong here ? Any help is appreciated.

At runtime X will have 3 dimensions, right? They show them in the instructions as (m, Tx, nvalues). So when you “slice” X on the timestep, you are slicing on the 2nd dimension, right?

Actually I think your dimensions may be correct. I added print statements in my code and here’s what I see:

x.shape before reshaper (None, 90)
x.shape after reshaper (None, 1, 90)

The point here is that we’re just defining the model, so we don’t have actual input data (yet) and thus don’t know the first dimension (batch size or m).