DSRAN icon indicating copy to clipboard operation
DSRAN copied to clipboard

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

Open mymuli opened this issue 3 years ago • 3 comments

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

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

mymuli avatar Nov 15 '20 08:11 mymuli

非常感谢您的关注。

(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.

kywen1119 avatar Nov 15 '20 09:11 kywen1119

您好: 我还想问一下,关于GAT.py文件里面,第80行--第87行代码的含义是什么? https://github.com/kywen1119/DSRAN/blob/dbb5cf6e3c335fe3861d9d0ccbc6ab71ee58de91/GAT.py#L80 这部分内容在您的论文里面没有找到相关定义或解释,可以帮忙解释一下呢? 十分感谢

mymuli avatar Nov 23 '20 11:11 mymuli

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

kywen1119 avatar Nov 24 '20 04:11 kywen1119