C3W1 & C3W2 important tip

For anyone who is stuck on C3W1 or C3W2, try to use “axis=-1” at relevant locations. It could save you several hours.
I highly recommend the tutor add this in the hint.

1 Like

Hi @ejint

Could you mention the specific exercises that you think would need reminding of using correct axis?

C3W1 Exercise 5
log_ppx = np.sum(log_p, axis=-1) / np.sum(non_pad, axis=-1)

C3W2 Exercise 5
y_pred_class = tf.math.argmax(y_pred, axis=-1)

C3 W1 Exercise 5 could indeed have a reminder to use the appropriate axis argument, while C3 W2 already does:

Exercise 5

Instructions: You will maked a masked version of the accuracy function. You will need to perform an argmax to get the predicted label for each element in the batch. Remember to provide the appropriate axis in the argmax function…

Thank you