Emojify_v2 course_5 Week_2 Ex_5

I got test error and i need help

Test failed
Expected value

[‘Dense’, (None, 5), 645, ‘linear’]

does not match the input value:

[‘Dense’, (None, 5), 645, ‘softmax’]

AssertionError Traceback (most recent call last)
in
22
23
—> 24 Emojify_V2_test(Emojify_V2)

in Emojify_V2_test(target)
19
20 expectedModel = [[‘InputLayer’, [(None, 4)], 0], [‘Embedding’, (None, 4, 2), 30], [‘LSTM’, (None, 4, 128), 67072, (None, 4, 2), ‘tanh’, True], [‘Dropout’, (None, 4, 128), 0, 0.5], [‘LSTM’, (None, 128), 131584, (None, 4, 128), ‘tanh’, False], [‘Dropout’, (None, 128), 0, 0.5], [‘Dense’, (None, 5), 645, ‘linear’], [‘Activation’, (None, 5), 0]]
—> 21 comparator(summary(model), expectedModel)
22
23

~/work/W2A2/test_utils.py in comparator(learner, instructor)
21 “\n\n does not match the input value: \n\n”,
22 colored(f"{a}", “red”))
—> 23 raise AssertionError(“Error in test”)
24 print(colored(“All tests passed!”, “green”))
25

AssertionError: Error in test

Thanks
Abebe

After the Dense layer, did you add a “softmax” Activation?

1 Like

Thank you for your reply. Yes I did, but I used the activation two times like the code below. For the dense I used this Tf docum Dense ()

X = Dense(units = 5, activation = "softmax")(X)

X = Activation("softmax")(X)

Finally, I got my mistake and figured out. Your reply as well the Additional hint in the exercise is helpful.
Thank you.
Abebe