UNQ_C1
GRADED FUNCTION: djmodel
After this function, which returns ‘model, the variable, ’model’ is assigned as :
model = djmodel(Tx=30, LSTM_cell=LSTM_cell, densor=densor, reshaper=reshaper)
Now, when the next unit, ‘#Unit Test’ is run, I get this in the output:
Test failed at index 1
Expected value
[‘TensorFlowOpLayer’, [(None, 90)], 0]
does not match the input value:
[‘Lambda’, (None, 90), 0]
AssertionError Traceback (most recent call last)
in
1 # UNIT TEST
2 output = summary(model)
----> 3 comparator(output, djmodel_out)
~/work/W1A3/test_utils.py in comparator(learner, instructor)
24 “\n\n does not match the input value: \n\n”,
25 colored(f"{b}", “red”))
—> 26 raise AssertionError(“Error in test”)
27 print(colored(“All tests passed!”, “green”))
28
AssertionError: Error in test
The next unit,
“# Check your model
model.summary()” , however, runs and gives an ‘expected’ output.
And the trouble is that after compiling and initialising the hidden state and cell state, the code for ‘training the model’:
history = model.fit([X, a0, c0], list(Y), epochs=100, verbose = 0),
Does not succeed, and ‘history’ is ‘not defined’.
QUESTION: Has djmodel been correctly done?