C5-W1-A3 UNQ_C3 wrong results

I am getting the following results:

np.argmax(results[12]) = 0
np.argmax(results[17]) = 0
list(indices[12:18]) = [array([88]), array([66]), array([14]), array([53]), array([42]), array([39])]

Expected (Approximate) Output:
Your results may likely differ because Keras' results are not completely predictable.
However, if you have trained your LSTM_cell with model.fit() for exactly 100 epochs as described above:
You should very likely observe a sequence of indices that are not all identical. Perhaps with the following values:
**np.argmax(results[12])** =	26
**np.argmax(results[17])** =	7
**list(indices[12:18])** =	[array([26]), array([18]), array([53]), array([27]), array([40]), array([7])]

The grader says the function is incorrect, but I don’t see what’s wrong.

In predict_and_sample(), at Step 2, what value did you use for “axis=?”

Hi TMosh,

In the tf.math.argmax I used axis=-1

I should add that the unit tests for Inference Model did pass and the grader seems to also give it a pass.

Code Cell UNQ_C1: Function ‘djmodel’ is correct.
Code Cell UNQ_C2: Function ‘music_inference_model’ is correct.
Code Cell UNQ_C3: Unexpected error (ValueError('operands could not be broadcast together with shapes (13,1,90,90) (13,90) ')) occurred during function check. We expected function predict_and_sample to return Test 3 failed. Please check that this function is defined properly.
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors.

Tip for those who find this thread later:

Check the arguments you’re using with to_categorical(…).

1 Like

Thank you Tom M. That was it. Appreciate the help!!