Reading PyTorch code, I interpret ignore_index
as being a target value to ignore, so can have ignored ground truth data, for instance if you had a class hierarchy and didn't care about mis-classifications in sub-parts of the hierarchy unrelated to the ground truth. So you might set your ground truth to [1, 0, 1, 0, 0, -100, -100, -100]
if first values were class 1, 1a, 1b, 1c, 2, 2a, 2b, 2c, and your target class is 1b