kamenbliznashki / chexpert

CheXpert competition models -- attention augmented convolutions on DenseNet, ResNet; EfficientNet
MIT License
52 stars 20 forks source link

Question on h_rel_logits and w_rel_logits #5

Closed egistific closed 4 years ago

egistific commented 4 years ago

Hi, I would like to know if the h_rel_logit takes the form [B nh W W H H] and w_rel_logit [B nh H H W W]. Then they are permuted to [B Nh H W H W] and reshaped to pB, Nh, HW, HW]?

If this is the case, the permuations in lines 83 and 84 in class AAConv2d should be switched around to this: h_rel_logits = h_rel_logits.permute(0,1,4,2,5,3).reshape(B, self.nh, HW, HW) w_rel_logits = w_rel_logits.permute(0,1,2,4,3,5).reshape(B, self.nh, HW, HW)

I'm not sure if I have have misinterpreted something. Could you help clarify? Thank you.

kamenbliznashki commented 4 years ago

Hi - you are correct, thanks for pointing this out. h_rel_logits should be permuted [0,1,4,2,5,3] since q is permuted before sending it to relative_logits_1d in the computation of h_rel_logits. I'll push an update.