ZhiyuanDang / NNM

The PyTorch official implementation of the CVPR2021 Poster Paper NNM: Nearest Neighbor Matching for Deep Clustering.
Other
59 stars 7 forks source link

The samples' predictions consistent #3

Closed TryHard-LL closed 2 years ago

TryHard-LL commented 3 years ago

Hi, I have a question about the consistent term in the loss. If do so, can't we get a trivial solution? The final clustering result is not a trivial solution,because of using the pretext tasks to learn representations?

ZhiyuanDang commented 3 years ago

Hi @HBU-Lin-Li ,

According to Tab.3, L_entropy can prevent trivial solutions.

TryHard-LL commented 3 years ago

Thank you.

TryHard-LL commented 2 years ago

Hi @ZhiyuanDang , The consistent loss is same as 'consistency_loss' in SCANLoss?

ZhiyuanDang commented 2 years ago

yes

TryHard-LL commented 2 years ago

In code, " def forward(self, anchors, neighbors, anchor_augmented, clustering_results, index, batch_index): """ input:

It does not match the paper:

image

TryHard-LL commented 2 years ago

In paper, p is anchor,N_loacl(p) is 'p' neighbor in current bacth and N_pre(p) is pretrain's feature?

ZhiyuanDang commented 2 years ago

In paper, p is anchor,N_loacl(p) is 'p' neighbor in current bacth and N_pre(p) is pretrain's feature?

N_pre(p) is the neighbor from pre-trained features, i.e. positives_prob in the code

TryHard-LL commented 2 years ago

大哥,不装了,摊牌了。。。我着实没看明白论文跟代码 的一致性损失是怎么对应的。。 文章中P是指的当前的batch中的某个样例,N_local(p)是当前batch中的近邻,N_pre(p)是预训练特征中的NN,它是batch中的最近邻还是说是样本集中的最近邻呢? 代码中,anchors是指当前的样例,即p,neighbors是指N_pre(p),那anchor_augmented指的是p样例对应的另一种增强得到的样例p_aug吗?那positive_pro_augmented又对应的是什么呢。。。

谢谢大哥!

ZhiyuanDang commented 2 years ago

anchor_augmented是anchors的增强样本。positives_prob_augmented 是anchor的近邻样本的分类输出,对应于N_local(p)。

TryHard-LL commented 2 years ago

意思是positives_prob是pretrain得到的一个近邻,positives_prob_augmented是anchor在当前batch中训练时找到的NN?

ZhiyuanDang commented 2 years ago

意思是positives_prob是pretrain得到的一个近邻,positives_prob_augmented是anchor在当前batch中训练时找到的NN?

对的

TryHard-LL commented 2 years ago

那论文中的公式处那两个P,是不是应该是一个P,一个P_aug。。。

ZhiyuanDang commented 2 years ago

那论文中的公式处那两个P,是不是应该是一个P,一个P_aug。。。

是的,但是两个p和一个p一个p_aug结果差不多

TryHard-LL commented 2 years ago

嗯嗯,好,谢谢您

ZhiyuanDang commented 2 years ago

没事

TryHard-LL commented 2 years ago

这个N_pre(p)是预训练时,也在当前的bacth中得到吗

ZhiyuanDang commented 2 years ago

嗯,这个是预训练的时候,整体进行了近邻样本的找寻,然后保存每个anchor的近邻样本的Index,然后在每次训练的时候用dataloader加载进来,具体看看代码就理解了

TryHard-LL commented 2 years ago

好嘞,谢谢