The. error is thrown in this line but it might be caused by previous mistakes:
matches_true_pred *= None
I don’t want to violate CoC but the answer for this line was in the lecture and I did the same.

Going from a top what should be updated by me in the ex.
mask => I’m checking with tf.equal if y_pred is == -1
y_pred_class => tf.math.argmax, same as in the lecture
matches_true_pred => comparing t_true and y_pred_class

Is there any obvious mistake in the above logic? I can’t see it.
Thank you in advance for all help

You’re right. It’s week 2 in the refreshed training. The assignment is on TF not trax.
The category was wrongly selected and I don’t know how to change it.

Are you passing the axis argument in tf.math.argmax? If you do not pass the axis argument, it is default to 0, which means you are performing the argmax across the columns and this is not what you want.

Furthermore, I would like just to point that the mask should indicate the values that are different from -1 and not equal to -1, otherwise you will be removing the non masked values after masking.

In tf.math.argmax I’ve got an axis assigned; however, if I have the mask that indicate the values not equal to -1 the code fails the unittest and generates the above error. That is, if the mask indicates the values equal to -1 then it passes the unittest but also generates the above error message.

I’ve tried different values for the axis in argmax and only one value doesn’t generate an error.

@lucas.coutinho Thank you for helping us in learning NLP. I am struggling to get the masked_accuracy function correct . Could you please help me in understand the function more? I don’t understand mask values and I have some doubts regarding y_true and y_pred. Could you please help me in that? If possible can we have quick chat/call? Please help.

@lucas.coutinho Thank you for helping us in learning NLP. I am struggling to get the masked_accuracy function correct . Could you please help me in understand the function more? I don’t understand mask values and I have some doubts regarding y_true and y_pred. Could you please help me in that? If possible can we have quick chat/call? Please help.

I need help in this case the masked accuracy function is raising some problem regarding the tensor being broadcastable and not. The shape depicts it is (1,) but changes into some other by running it. May you help in this regard?