I am fine-tuning BertModel for Sentiment Analysis with Crossentropy loss.
But it only trains if labels are positive in nature but when training for negative labels it throws an error.
For ex- it labels are 0,1,2 it trains perfectly.
But if labels are 0,1,-1 it throws an error-
cross-entropy IndexError: Target -1 is out of bounds.
Everything else is same.
So do I have to use a different loss function?