Jazz djmodel function AssertionError params 8190

Hi,

model = djmodel(Tx=30, LSTM_cell=LSTM_cell, densor=densor, reshaper=reshaper)
output = summary(model)
comparator(output, djmodel_out)

Above lines throws AssertionError as follows: Test expects params to be 45530 but my params 8190. How to solve ? Anyone can help?

AssertionError: Error in test. The lists contain a different number of elements

Tx:30
n_a = 64
n_values = 90
reshaper = Reshape((1, n_values))
LSTM_cell = LSTM(n_a, return_state = True)
densor = Dense(n_values, activation=‘softmax’)
X.shape = shape of X: (60, 30, 90)
Y.shape = shape of Y: (30, 60, 90)

My function is:

{moderator edit - solution code removed}

Thank you very much in advance.

The compute graph of your model is incorrect. You’ve literally ignored the output of the LSTM_cell: what happens to the a value that is returned there? Nothing, right? So effectively that call is a NOP from the point of view of the compute graph, which is why all the trainable parameters there are ignored.

Also I found that using that complicated Lambda function to “slice” X at the beginning of the for loop did not work for me. Just do the slicing you want as a plain assignment statement and it worked fine for me.