Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about stage2 #8

Closed
zhangbin0917 opened this issue Jul 5, 2020 · 4 comments
Closed

Question about stage2 #8

zhangbin0917 opened this issue Jul 5, 2020 · 4 comments

Comments

@zhangbin0917
Copy link

zhangbin0917 commented Jul 5, 2020

Nice work! I am a novice in the domain adaptation field. I have a question about stage2.
In my understanding about your paper, uncertainty estimation is used for target domain images.
But in your code trainer_ms_variance.py, it seems to be calculated on the image of the source domain.

    def gen_update(self, images, images_t, labels, labels_t, i_iter):
            self.gen_opt.zero_grad()

            pred1, pred2 = self.G(images)
            pred1 = self.interp(pred1)
            pred2 = self.interp(pred2)

            if self.class_balance:            
                self.seg_loss = self.update_class_criterion(labels)

            loss_seg1 = self.update_variance(labels, pred1, pred2) 
            loss_seg2 = self.update_variance(labels, pred2, pred1)
 
            loss = loss_seg2 + self.lambda_seg * loss_seg1
@layumi
Copy link
Owner

layumi commented Jul 5, 2020

In the stage-II, I set the image path to target domain. We do not use the source image any more.

https://github.com/layumi/Seg-Uncertainty/blob/master/train_ft.py#L35-L41

@zhangbin0917
Copy link
Author

Thanks for reply. I got it.
But why you use two loaders for target domain iamges, trainloader and targetloader. Why not use one dataloader to calculate the all loss?

@layumi
Copy link
Owner

layumi commented Jul 5, 2020

At that time, I hope that Trainer could be re-used in the stage-I.

@zhangbin0917
Copy link
Author

Got it, 3q.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants