Skip to content

Commit

Permalink
Day4
Browse files Browse the repository at this point in the history
WCL
  • Loading branch information
lgX1123 committed Nov 13, 2023
1 parent 7902eff commit 3a12d5e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
Binary file added figs/NCE_loss_improved.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figs/NCE_loss_original.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figs/Swap_loss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figs/WCL_WL_generation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figs/WCL_framework.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 25 additions & 7 deletions notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@

## 1. ML

## 2. DL
## 2. DL-basic

### 2.1 Basic

#### 2.1.1 Transformer
### 2.1.1 Transformer

* [Attention is all you need! ](https://arxiv.org/pdf/1706.03762.pdf)

Expand Down Expand Up @@ -49,14 +47,34 @@ v: [batch_size, src_len, dv]
* 至于代码怎么实现,很牛逼,直接把头的维度弄到batch里


### 2.2 NLP
## 2.2 NLP

### 2.2.1 Bert

## 2.3 CV

### 2.3.1 self-supervised

#### 2.2.1 Bert
#### Weakly Supervised Contrastive Learning
MK师兄的论文,主要是解决label很少的图像分类任务

### 2.3 CV
![Alt text](figs/WCL_framework.png)

原有的loss between positive pair i, j:
![Alt text](figs/NCE_loss_original.png)
这里的问题在于,这会让两个属于相同class的positive sample的similarity变小(分母),虽然会让这个positive pair i, j的similarity变大(分子),叫做 instance discrimination。所以这里这个损失函数可以改良一下:
![Alt text](figs/NCE_loss_improved.png)
这里的y表示i,j 是否是同一个class
那么怎么整这个y出来呢?
简单来说,对于一个batch,每个样本有一个embedding vector,然后对每个样本找1- nearest neighbor,这样的pair就连起来。那么问题就很轻易的转化为,给定一组nodes和edges,找每个联通量,每个联通量属于同一个weak label。
![Alt text](figs/WCL_WL_generation.png)
好处: parameter-free,reciprocal,deterministic process

这swapped version是啥子意思??
![Alt text](figs/Swap_loss.png)
这y是怎么当label的,咋加到公式里?

还有一个问题是,multi-crop可以提高representation的质量。但是怎么剪,也是有说法的。光增加数量肯定不行,不光会增加计算量,还会overlap。这里用了KNN based low-resolution multi-crop strategy 来解决这两个问题。因为每个epoch都会产生一个primary feature h1,基于此用KNN来找每个sample的crops,用于下个epoch的训练。



Expand Down

0 comments on commit 3a12d5e

Please sign in to comment.