sure !
this is part of the code in my train function
for i in range(sentence_prime.size()[0]):
embedding_prime.append(weights_matrix2[int(sentence_prime[i])])
embedding_target.append(weights_matrix2[int(word_targets[i])])
loss2 = loss(torch.stack(embedding_prime),torch.stack(embedding_target))
total_loss = loss + loss2
total_loss.backward()
optimizer.step()
taking into account that
loss = nn.CosineSimilarity()