bfshi / AbSViT

Official code for "Top-Down Visual Attention from Analysis by Synthesis" (CVPR 2023 highlight)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

about the tokeen(vector) td

lisx123 opened this issue · comments

commented

In paper Figure 3, past vector td to Att, What i wang to know is that ,the td vector is Sentence embedded By something(e.g BERT) ,or just one word or two words 'embeded vector?

how das the td vector and xbu combined to get V

in Chinese:
td,token,是表示一个句子还是说一两个单词,如例子中bridge,dog?,然后**xtd向量是如何与xud结合得到V**的?

多谢解答
thanks a lot

你好,td token可以是一个单词的embedding,也可以是一个句子的embedding(比如VQA中关于某张图片的问题)。

td token经过feedback path之后,加在了每一层self-attention中的V向量上(原本V=W_v * xbu,现在V=W_v * (x_bu + x_td))。

commented

你好,td token可以是一个单词的embedding,也可以是一个句子的embedding(比如VQA中关于某张图片的问题)。

td token经过feedback path之后,加在了每一层self-attention中的V向量上(原本V=W_v * xbu,现在V=W_v * (x_bu + x_td))。
多谢您的回答,同时看了您的vision,lannguage的代码实现代码,有一个疑问,cos_sim = F.normalize(x, dim=-1) @ F.normalize(prompt[..., None], dim=1),这里计算V(x)与prompte的loss,和任务比如vqa的loss,是在最终相加一起迭代的吗?

       meter_utils.set_task(self)
       output = self(batch)
       total_loss = sum([v for k, v in output.items() if "loss" in k])
       return total_loss ```

是的,loss是加在一起优化的

commented

是的,loss是加在一起优化的
多谢回答