YU1ut / MixMatch-pytorch

Code for "MixMatch - A Holistic Approach to Semi-Supervised Learning"
MIT License
633 stars 129 forks source link

Unlabelled batch size #39

Open AlexTS1980 opened 3 years ago

AlexTS1980 commented 3 years ago

According to the paper, there's a set of labelled and unlabelled datapoints that are mixed. In the code nevertheless there are two unlabelled sets, u1 and u2. Both of them are added to the mixed set. So my question is, why are there two such sets?

dadaplm commented 3 years ago

Same question.

YU1ut commented 3 years ago

In Sec. 3.1 of the paper, ''For each u in the batch of unlabeled data U, we generate K augmentations.'' And K is 2 in the paper, so u1 and u2 are used.

dadaplm commented 3 years ago

In Sec. 3.1 of the paper, ''For each u in the batch of unlabeled data U, we generate K augmentations.'' And K is 2 in the paper, so u1 and u2 are used.

Thank you,another question is that in the code "inputs_u" and "inputs_u2" are from the different batch ? Can I change "(inputs_u, inputsu2), = unlabeled_train_iter.next()" into "inputs_u = unlabeled_train_iter.next() inputs_u2 = unlabeled_train_iter.next()" ? Thank you so much.

dadaplm commented 3 years ago

In Sec. 3.1 of the paper, ''For each u in the batch of unlabeled data U, we generate K augmentations.'' And K is 2 in the paper, so u1 and u2 are used.

I use another dataset.

YU1ut commented 3 years ago

They are from the same batch but with different augmentations. See here: https://github.com/YU1ut/MixMatch-pytorch/blob/master/dataset/cifar10.py#L7-L14