I am running SSL training on Kinetics and BDD (Berkeley Deep Drive) datasets. As I saw in the _trainnet.py file, when the task is "ssl" and the model name is "ContrastiveModel", the labels are replaced with zeros (line 144):
if cfg.TASK == "ssl" and cfg.MODEL.MODEL_NAME == "ContrastiveModel":
labels = torch.zeros(
preds.size(0), dtype=labels.dtype, device=labels.device
)
So, it appears that for SSL training we do not need any labels. However, in the config file, there is still a parameter called "MODEL.NUM_CLASSES". This parameter, number of classes, is set to 128 for the ssl config file, _MoCo_SlowR508x8.yaml, and to 256 for the _BYOL_SlowR508x8.yaml ssl config file, both for the Kinetics data set. Kinetics400 and Kinetics600 data sets have 400 and 600 classes respectively but where does this number 128 or 256 come from for this _MODEL.NUMCLASSES parameter come from?
Hence, what is the purpose of this _MODEL.NUMCLASSES parameter? Does this parameter have any connection to the labels or number of classes in the data set? Can I still use a data set with no labels for SSL training, such as the BDD data set?
I am running SSL training on Kinetics and BDD (Berkeley Deep Drive) datasets. As I saw in the _trainnet.py file, when the task is "ssl" and the model name is "ContrastiveModel", the labels are replaced with zeros (line 144):
So, it appears that for SSL training we do not need any labels. However, in the config file, there is still a parameter called "MODEL.NUM_CLASSES". This parameter, number of classes, is set to 128 for the ssl config file, _MoCo_SlowR508x8.yaml, and to 256 for the _BYOL_SlowR508x8.yaml ssl config file, both for the Kinetics data set. Kinetics400 and Kinetics600 data sets have 400 and 600 classes respectively but where does this number 128 or 256 come from for this _MODEL.NUMCLASSES parameter come from?
Hence, what is the purpose of this _MODEL.NUMCLASSES parameter? Does this parameter have any connection to the labels or number of classes in the data set? Can I still use a data set with no labels for SSL training, such as the BDD data set?