20260706:新增一些文章
This commit is contained in:
31
concepts/contrastive-learning.md
Normal file
31
concepts/contrastive-learning.md
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
title: "对比学习 (Contrastive Learning)"
|
||||
created: 2026-07-04
|
||||
updated: 2026-07-04
|
||||
type: concept
|
||||
tags: [self-supervised, representation-learning, embedding, multimodal]
|
||||
sources: []
|
||||
---
|
||||
|
||||
# 对比学习 (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 的嵌入在语义上与其描述的概念对齐。
|
||||
|
||||
## 参考
|
||||
|
||||
- [[clip|CLIP]]
|
||||
- [[vision-language-models|VLM]]
|
||||
- [[cosine-similarity-geometry|余弦相似度几何]]
|
||||
- [[text-proxy-for-semantics|文本语义代理]]
|
||||
Reference in New Issue
Block a user