tsun / SSRT

Safe Self-Refinement for Transformer-based Domain Adaptation (CVPR 2022)
MIT License
39 stars 7 forks source link

About the loss #7

Closed 23425Ning closed 5 months ago

23425Ning commented 5 months ago

Hello, thanks for ur excellent work, while there is question for me about ur way to calculate the loss for the dataset of Office-Home Firstly, there isn't a parameter named 'rand_aug ' in the file of main_SSRT.office_home.py, while I know it is perturbation u guys mentioned in paper for images. Then, in the file of data_provider.py, the parameter 'rand_aug' is applied for the target_train_loader, not also for source_val_loader, it is corresponding to ur paper description for fig3. While calculating the total loss, ur code is as follows if args.rand_aug: total_loss = model_instance.get_loss(inputs_source, inputs_target, labels_source, labels_target, inputs_rand_target, args=args) In my understanding, if setting the rand_aug, then would calculate the SR loss for tar images, while ur code in SSRT.py, the 'get_loss' code is as follows def get_loss(self, inputs_source, inputs_target, labels_source, labels_target=None, args=None): the paramters did not include the inputs_rand_target, the parameters cant match, I would like to ask why Very much looking forward to your reply to me, and thanks a lot for ur work

tsun commented 5 months ago

Hello @23425Ning , thanks for your interest in our work. 'rand_aug' is defined here . By default, its value is False.

rand_aug is not a parameter for our SR, loss. It is used to indicate whether using a strong data augmentation for the target images, please see here.

Regarding our SR loss, it is controlled by args.sr_layers, please see here. And the pertubation is conducted in Ln 67 and Ln 87.

23425Ning commented 5 months ago

Thanks quite a lot, ur explanation is straight to the point, sorry for my careless