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

Questions about the correct module #12

Open
WangQingchen123 opened this issue Jan 17, 2024 · 0 comments
Open

Questions about the correct module #12

WangQingchen123 opened this issue Jan 17, 2024 · 0 comments

Comments

@WangQingchen123
Copy link

In the correct function in algorithms/RAINCOAT.py, src_y in the incoming arguments is not called, and the correct process is no different from the update training process.

    def correct(self, src_x, src_y, trg_x):
        self.coptimizer.zero_grad()
        src_feat, out_s = self.feature_extractor(src_x)
        trg_feat, out_t = self.feature_extractor(trg_x)
        src_recon = self.decoder(src_feat, out_s)
        trg_recon = self.decoder(trg_feat, out_t)
        recons = 1e-4 * (self.recons(trg_recon, trg_x) + self.recons(src_recon, src_x))
        recons.backward()
        self.coptimizer.step()
        return {'recon': recons.item()}

I'm not quite sure how this code achieves pulling close the same labeled samples and rejecting unknown samples in the target domain

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

1 participant