Files
myWiki/concepts/contrastive-learning.md

1.1 KiB
Raw Blame History

title, created, updated, type, tags, sources
title created updated type tags sources
对比学习 (Contrastive Learning) 2026-07-04 2026-07-04 concept
self-supervised
representation-learning
embedding
multimodal

对比学习 (Contrastive Learning)

一种自监督/监督表示学习方法,通过拉近正样本对、推开负样本对来学习有判别力的嵌入表示。

核心损失

\mathcal{L} = -\log \frac{\exp(\text{sim}(z_i, z_i^+)/\tau)}{\sum_j \exp(\text{sim}(z_i, z_j)/\tau)}
  • $z_i, z_i^+$:正样本对(匹配的图文/增强视图)
  • $z_j$batch 中所有样本(包括负样本)
  • $\tau$:温度参数

在 VLM 中的作用

CLIP 的对比训练使文本嵌入成为嵌入空间中的语义锚点——匹配的图文对被拉近,不匹配的被推开。这是 text-proxy-for-semantics 有效的基础:文本 prompt 的嵌入在语义上与其描述的概念对齐。

参考