The detailed problem is as follows:
I have a dataset. It has two parts: training and test. The training data has 40 classes and the test data has 20 classes. It is noted that this 20 classes of test data are common with the training data. During training, I will train both training and test data. The training data has label whereas the test data do not have label. I would like to use 2 loss functions jointly during training: Classification loss and distance loss. I would like to use classification loss for the labeled data and distance loss for the 20 common classes. How can I ignore other 20 classes from the training set which are not common in the test dataset?