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.,
#code
loss = criterion(pred, gtruth) + 0.01 * (1 - cosineSim(pred_repj, gtruth_repj))
or
loss = criterion(pred, gtruth) + 0.01 * ( cosineSim(pred_repj, gtruth_repj))
#code
Do I need to take care any other aspect if  I am adding similarity score in this way?