SimCSE-Chinese-Pytorch icon indicating copy to clipboard operation
SimCSE-Chinese-Pytorch copied to clipboard

关于ce损失的问题

Open qishibo opened this issue 3 years ago • 1 comments

https://github.com/vdogmcgee/SimCSE-Chinese-Pytorch/blob/main/simcse_unsup.py#L142-L145

image

这里求对比损失的时候又在loss外面包了一层torch.mean(loss),ce默认已经是mean均值形式了,为什么返回的时候又执行mean操作呢

qishibo avatar Dec 13 '21 09:12 qishibo

感谢指正 , 这一步是有点多余了 , 没必要再算一次

vdogmcgee avatar Dec 14 '21 09:12 vdogmcgee