常用的loss: NT-Xent loss,全称为Normalized Temperature-scaled Cross Entropy Loss来自[1]simCLR 一个batch 有N 个样本,两条分支就有2N个samples。对于一个anchor样本i,除了对应的augmented image和自己,其余2N-2个都是负样本。分子是正样本之间的相似度,分母是负样本之间相似度。
temp): """ NT-Xent Loss. Args: z1: The learned representations from first branch of projection head z2: The learned representations from second branch
Source: SimCLR 可应用任务 图像分类 模型数量 1762 目标检测 模型数量 879 动作识别 模型数量 348 行人重识别 模型数量 203 图像聚类 模型数量 67 音乐自动标记 模型数量 3 使用「Normalized Temperature-scaled Cross Entropy Loss(NT-Xent)」的项目