Raincoat icon indicating copy to clipboard operation
Raincoat copied to clipboard

Questions about the correct module

Open WangQingchen123 opened this issue 1 year ago • 0 comments

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

WangQingchen123 avatar Jan 17 '24 08:01 WangQingchen123