Open Kkkkkz21 opened 3 months ago
Because mask_bi
is not really the index of the img_cap_list
. Rather, it's the batch index.
See the below example:
a = [[1,2],[1,2],[3,4]]
mask_bi = [i for i,e in enumerate(a) for _ in e]
print(mask_bi)
>>> [0, 0, 1, 1, 2, 2]
(Suppose the structure of img_cap_list
is the same of a
)
Why isn't mask_bi taken from the index of img_cap_list? If i is taken, there will be corresponding errors in calculating the contrastive loss later.