Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于公式(9)和公式(10) #1

Open
mymuli opened this issue Nov 15, 2020 · 3 comments
Open

关于公式(9)和公式(10) #1

mymuli opened this issue Nov 15, 2020 · 3 comments

Comments

@mymuli
Copy link

mymuli commented Nov 15, 2020

非常感谢您开源论文的代码。

请问一下,
(1)在论文中公式(9)和公式(10)的计算,在开源的代码中,model.py或者GAT.py文件中,哪几行是计算这个的呢?
(2)看到您在跑mscoco数据集时,batch_size=300,想问一下,您的实验硬件环境(GPU的个数、型号、单个显存大小)是什么?
(3)在ResNet152的基础上,加入GAT网络,模型的参数引入较大,在mscoco训练的时候,有什么技巧呢?

@kywen1119
Copy link
Owner

kywen1119 commented Nov 15, 2020

非常感谢您的关注。

(1)首先对于公式(9),graph的构建有两个必然要素——即节点nodes以及边edges,公式(9)即是计算边的公式。这部分在代码中是隐式的而不是显示的,因为在graph attention的构建中(公式(2)、(3)),用于计算两个节点相似度时已完成了对边edge的计算。此部分在代码中体现在GAT.py中Multihead attention的部分(44行)。
对于公式(10),相关部分位于model.py中251行img_emb_orig = self.gat_2(self.img_enc(images)),或者model_bert.py中224行img_emb_orig = self.gat_1(self.img_enc(images_orig))。
(2)在mscoco实验中,batch_size=300时使用一张NVIDIA 1080Ti显卡(11gb显存),或者一张TITAN XP显卡(12gb显存)。
(3)对于ResNet152的部分,在我的网络中他的参数是被固定的,不参与训练,只用于全局特征的提取,因此不会占用较多.

Thank you very much for your attention.

(1) First of all, for formula (9), the construction of graph has two necessary elements: nodes and edges. Formula (9) is the formula for calculating edges. This part is implicit rather than displayed in the code, because in the construction of graph attention (formulas (2), (3)), the calculation of the edge has been completed when calculating the similarity of two nodes. This part of the code is reflected in the Multihead attention part of GAT.py (line 44). For formula (10), the relevant part is located at line 251 in model.py img_emb_orig = self.gat_2(self.img_enc(images)), or line 224 in model_bert.py img_emb_orig = self.gat_1(self.img_enc(images_orig)).
(2) In the mscoco experiment, an NVIDIA 1080Ti gpu (11gb memory) or a TITAN XP gpu (12gb memory) is used when batch_size=300.
(3) For the part of ResNet152, in my network, its parameters are fixed and do not participate in training. It is only used for global feature extraction, so it will not occupy much memory during training.

@mymuli
Copy link
Author

mymuli commented Nov 23, 2020

您好:
我还想问一下,关于GAT.py文件里面,第80行--第87行代码的含义是什么?

DSRAN/GAT.py

Line 80 in dbb5cf6

attention_output = self.fc_in(attention_output)

这部分内容在您的论文里面没有找到相关定义或解释,可以帮忙解释一下呢? 十分感谢

@kywen1119
Copy link
Owner

这部分就是一些feed-forward-network的操作

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants