I have a dataset A that contains the high-resolution and low-resolution of flower images. They are labeled as 6 classes. During training, I will randomly select 16 high resolution and 16 low-resolution image and feed them to the network (total we will feed 32 images–batch size =32). A cross-entropy loss will be used as a loss function to train the classifier.
I want to assign the higher weight for training high-resolution image and lower weight for training low-resolution image.  Is it possible in pytorch? And how to do it? The dataloader will return likes
high_res_image, class_high_res, low_res_image, class_low_res = data

If I used the loss likes
criterion = torch.nn.CrossEntropyLoss()
high_res_image, class_high_res, low_res_image, class_low_res = data
pred_high = networ(high_res_image)
pred_low = networ(low_res_image)
loss_total = 0.7* criterion(pred_high, class_high_res) + 0.3* criterion(pred_low, class_low_res) 

For above code, we just use the batch size of 16 instead of 32 because we feed the data seperately. Any good suggestion to use full 32 images and assign different weight for loss? Thanks.