Skip to content

domain_confusion

DomainConfusionHook

Bases: GANHook

Implementation of Simultaneous Deep Transfer Across Domains and Tasks

Source code in pytorch_adapt\hooks\domain_confusion.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
class DomainConfusionHook(GANHook):
    """
    Implementation of
    [Simultaneous Deep Transfer Across Domains and Tasks](https://arxiv.org/abs/1510.02192)
    """

    def __init__(self, **kwargs):
        super().__init__(
            disc_domain_loss_fn=torch.nn.CrossEntropyLoss(reduction="none"),
            gen_domain_loss_fn=UniformDistributionLoss(),
            **kwargs,
        )