def forward(self, v, b, q):
    'Forward\n\n        v: [batch, num_objs, obj_dim]\n        b: [batch, num_objs, b_dim]\n        q: [batch_size, seq_length]\n\n        return: logits, not probs\n        '
    w_emb = self.w_emb(q)
    q_emb = self.q_emb.forward_all(w_emb)
    boxes = b[:, :, :4].transpose(1, 2)
    b_emb = ([0] * self.glimpse)
    (att, logits) = self.v_att.forward_all(v, q_emb)
    for g in range(self.glimpse):
        b_emb[g] = self.b_net[g].forward_with_weights(v, q_emb, att[:, g, :, :])
        (atten, _) = logits[:, g, :, :].max(2)
        embed = self.counter(boxes, atten)
        q_emb = (self.q_prj[g](b_emb[g].unsqueeze(1)) + q_emb)
        q_emb = (q_emb + self.c_prj[g](embed).unsqueeze(1))
    logits = self.classifier(q_emb.sum(1))
    return (F.softmax(logits, dim=(- 1)), att)
Forward

v: [batch, num_objs, obj_dim]
b: [batch, num_objs, b_dim]
q: [batch_size, seq_length]

return: logits, not probs
def forward(self, v, b, q):
    'Forward\n\n        v: [batch, num_objs, obj_dim]\n        b: [batch, num_objs, b_dim]\n        q: [batch_size, seq_length]\n\n        return: logits, not probs\n        '
    w_emb = self.w_emb(q)
    q_emb = self.q_emb.forward_all(w_emb)
    boxes = b[:, :, :4].transpose(1, 2)
    b_emb = ([0] * self.glimpse)
    (att, logits) = self.v_att.forward_all(v, q_emb)
    for g in range(self.glimpse):
        b_emb[g] = self.b_net[g].forward_with_weights(v, q_emb, att[:, g, :, :])
        (atten, _) = logits[:, g, :, :].max(2)
        embed = self.counter(boxes, atten)
        q_emb = (self.q_prj[g](b_emb[g].unsqueeze(1)) + q_emb)
        q_emb = (q_emb + self.c_prj[g](embed).unsqueeze(1))
    logits = self.classifier(q_emb.sum(1))
    return (F.softmax(logits, dim=(- 1)), att)