LeapLabTHU / Agent-Attention

Official repository of Agent Attention (ECCV2024)
473 stars 35 forks source link

偏移的相关问题 #17

Closed MaChao1013 closed 8 months ago

MaChao1013 commented 8 months ago

作者你好: 今天有幸读了这篇文章,感觉非常的潜力。同时我目前在进行图像融合方面的研究,在此有几个问题希望作者可以解惑。 1.agent_tokens = self.pool(q[:, 1:, :].reshape(b, h, w, c).permute(0, 3, 1, 2)).reshape(b, c, -1).permute(0, 2, 1)在此行代码中,对Q做了切片处理,但是切片之后reshape的话是不是就没办法变成(b, h, w, c)了呢。 2.在Agent-feature加了bias,但是position_bias = torch.cat([self.ac_bias.repeat(b, 1, 1, 1), position_bias], dim=-1)这里的偏移是cat在一起的,这样的话不就多出一个维度了。 3.如果不加偏移的话,请问结果会有很大的出入吗 4.bias是依据什么来划分的呢。 期待您的回复

tian-qing001 commented 8 months ago

Hi @MaChao1013, thank you for your attention to our work. Regarding points 1 and 2, you highlighted the code for Agent-DeiT, which preserves the cls token of DeiT, resulting in an additional dimension, n+1. For points 3 and 4, I recommend consulting our paper, where we thoroughly outline the construction method of agent bias and present ablation experiments demonstrating its effectiveness.