Definition of the closest diagonal

The definition of the closest diagonal is “the highest number in the off-diagonals.” (C3, W3, Computing the Cost II, reading).

What if the closest diagonal value is greater than the diagonal value?

It’s an interesting question! I went back and listened to the lectures again (it had been a while :grinning_face:). My interpretation is that would mean that your model is very early in the training process and is not performing that well. But you would still follow the algorithm as described (picking the largest off diagonal value even though it is greater than the diagonal) and the cost function is designed to “fix” that problem by punishing the highest off diagonal value.

Professor Younes does not specifically mention this as a possibility, but he does discuss in detail the point that you want to use the closest negative value specifically because it represents the negative case that has the most useful information for pushing your model in the right direction. To phrase it another way, you want to use the worst case of the negative predictions (the one that the model got the most wrong) in order to have the best chance that the training will be driven to solve that problem: figuring out what it was missing by considering that wrong example to be a good match. If we get the case you suggest, that would just be an even more extreme version of the bad case that Prof Younes mentions, so it’s key that we force the training to address that issue.

as far my understanding in such scenario model will flag it as false positive or alignment failure if closest diagonal value is greater than diagonal value. This usually can happen if words or token don’t match semantically @Andy_0416