Hi, My apologies if my question is very naive. I am new to Pytorch.
I am trying to add cosine similarity score in cross entropy loss such a way that similarity score should be maximise. I am confused between fallowing two codes i.e.,
loss = criterion(pred, gtruth) + 0.01 * (1 - cosineSim(pred_repj, gtruth_repj))
loss = criterion(pred, gtruth) + 0.01 * ( cosineSim(pred_repj, gtruth_repj))
Do I need to take care any other aspect if I am adding similarity score in this way?