How was "We train using batches with 2 source images and 2 mixed images for 250k iterations" achieved in the code?
How was "We train using batches with 2 source images and 2 mixed images for 250k iterations" achieved in the code? I traced through the training code but did not see how this was implemented. Could anyone please point me to the class method/function that controls this part? Many thanks!
at if mix_mask == "class": for image_i in range(batch_size): classes = torch.unique(labels[image_i]) #classes=classes[classes!=ignore_label] nclasses = classes.shape[0] #if nclasses > 0: classes = (classes[torch.Tensor(np.random.choice(nclasses, int((nclasses+nclasses%2)/2),replace=False)).long()]).cuda()
if image_i == 0:
MixMask0 = transformmasks.generate_class_mask(labels[image_i], classes).unsqueeze(0).cuda()
else:
MixMask1 = transformmasks.generate_class_mask(labels[image_i], classes).unsqueeze(0).cuda()
i think they only use the first and the last element of the batch to perform Mixing pseudo label if you give the image batch size > 2 it will raise error when compute unlabelled loss