facebookresearch / adaptive_teacher

This repo provides the source code for "Cross-Domain Adaptive Teacher for Object Detection".
Other
183 stars 36 forks source link

Why discriminator is trained in supervised and target branch? #13

Closed Pandaxia8 closed 2 years ago

Pandaxia8 commented 2 years ago

I noticed that in the rcnn.py loss_D_img_s and loss_D_img_t are trained with a small weight. I don't know what is the meaning of these two lines of code?

Is this the way to initialize the discriminator? Will it prevent the model suffer from Model Collapse, which is caused by the discriminator?

losses["loss_D_img_s"] = loss_D_img_s*0.001 losses["loss_D_img_t"] = loss_D_img_t*0.001

Will the performance of the model be affected if the two lines of code above are removed and the model just be trained with the following two lines of code in the domain branch?

losses["loss_D_img_s"] = loss_D_img_s losses["loss_D_img_t"] = loss_D_img_t

yujheli commented 2 years ago

The weight is just for resolving the issue of distributed training. If you remove those two lines you will get the issue in the following issue: https://github.com/facebookresearch/adaptive_teacher/issues/5#issuecomment-1125499285

Pandaxia8 commented 2 years ago

The weight is just for resolving the issue of distributed training. If you remove those two lines you will get the issue in the following issue: #5 (comment)

Thanks for the answer