kimhc6028 / relational-networks

Pytorch implementation of "A simple neural network module for relational reasoning" (Relational Networks)
https://arxiv.org/pdf/1706.01427.pdf
BSD 3-Clause "New" or "Revised" License
809 stars 160 forks source link

Question on sort_of_clevr_generator "count+4" #29

Open lizhenstat opened 3 years ago

lizhenstat commented 3 years ago

Hi, thanks for your work and sharing of the code!!! I have on question on data generation part, I know the questions and answers are represented in one-hot vectors where questions = 2 x (6 for one-hot vector of color), 3 for question type(binary, ternary, norel), 3 for question subtype answers = yes, no, rectangle, circle, r, g, b, o, k, y

My question is why you use count+4 in here bianry question-subtype 3, which is as follows:

  elif subtype == 2:
      """count->1~6"""
      my_obj = objects[color][2]
      count = -1
      for obj in objects:
          if obj[2] == my_obj:
              count +=1 
      answer = count+4

As I understand, the count is already the number of Number of objects which have the same shape with the certain colored object. The +4 in [ yes, no, rectangle, circle, r, g, b, o, k, y] means the colors?

Any help would be appreciated and thanks for your time

dalek7 commented 3 years ago

Same question here.

Presumably, given that there are NO color-related questions in case of the binary question (i.e., question[q_type_idx+1] = 1), it seems to be intended to use count information from index 4. So, the answer variable means [yes, no, rectangle, circle, 0,1, 2, 3, 4, 5] in case of the binary question. This is for the case of the relational question; “How many objects have the same shape as the green object?”, described in the original paper.

Correct me if i am wrong.