ClassNLLCriterion counts the number of nonzero targets