Unused variables: q_obj_reps, a_obj_reps

21 views
Skip to first unread message

Arjun Singh

unread,
Apr 20, 2021, 1:32:39 PM4/20/21
to Visual Commonsense Reasoning
Hi, 

I am trying to understand the "forward" method of the model and I came across these two lines of code where the question and answer representations are created using the embed_span method.

I am not able to understand why the q_obj_reps and a_obj_reps variables are not used anywhere ahead in the code. Could you please explain the reason?


# Now get the question representations
q_rep, q_obj_reps = self.embed_span(question, question_tags, question_mask, obj_reps['obj_reps'])
a_rep, a_obj_reps = self.embed_span(answers, answer_tags, answer_mask, obj_reps['obj_reps'])




Kind regards,
Arjun

Rowan Zellers

unread,
Apr 20, 2021, 6:33:28 PM4/20/21
to Visual Commonsense Reasoning
hi Arjun,

Sorry for the confusion, the object representations are used to contextualize the question/answer respectively. However, the R2C model doesn't use those underlying representations afterwards (so it probably would have been better style for me to leave it out or write

# Now get the question representations
q_rep, _ = self.embed_span(question, question_tags, question_mask, obj_reps['obj_reps'])
a_rep, _ = self.embed_span(answers, answer_tags, answer_mask, obj_reps['obj_reps'])

hope that helps! thanks,
Rowan

Arjun Singh

unread,
Apr 21, 2021, 12:18:45 AM4/21/21
to Visual Commonsense Reasoning
Hi Rowan,

Thank you for your prompt response.

Kind regards,
Arjun

Reply all
Reply to author
Forward
0 new messages