imaginaire/trainers/cagan.py
def _init_loss(self, cfg):
        r"""Initialize loss terms. In FUNIT, we have several loss terms
        including the GAN loss, the image reconstruction loss, the feature
        matching loss, and the gradient penalty loss.

        Args:
            cfg (obj): Global configuration.
        """
        self.criteria['gen_basic'] = nn.BCELoss()
        self.criteria['dis_basic'] = nn.BCELoss()
        # self.criteria['dis_basic'] = nn.BCEWithLogitsLoss()
        self.criteria['clycle_loss'] = nn.L1Loss()

        for loss_name, loss_weight in cfg.trainer.loss_weight.__dict__.items():
            if loss_weight > 0:
                self.weights[loss_name] = loss_weight
        pass
r"""Initialize loss terms. In FUNIT, we have several loss terms
        including the GAN loss, the image reconstruction loss, the feature
        matching loss, and the gradient penalty loss.

        Args:
            cfg (obj): Global configuration.
        
r"""Initialize loss terms. In FUNIT, we have several loss terms
including the GAN loss, the image reconstruction loss, the feature
matching loss, and the gradient penalty loss.
r " " " Initialize loss terms . In FUNIT we have several loss terms including the GAN loss the image reconstruction loss the feature matching loss and the gradient penalty loss .
def _init_loss(self, cfg):
        self.criteria['gen_basic'] = nn.BCELoss()
        self.criteria['dis_basic'] = nn.BCELoss()
        self.criteria['clycle_loss'] = nn.L1Loss()
        for loss_name, loss_weight in cfg.trainer.loss_weight.__dict__.items():
            if loss_weight > 0:
                self.weights[loss_name] = loss_weight
        pass
def _init_loss ( self , cfg ) : self . criteria [ 'gen_basic' ] = nn . BCELoss ( ) self . criteria [ 'dis_basic' ] = nn . BCELoss ( ) self . criteria [ 'clycle_loss' ] = nn . L1Loss ( ) for loss_name , loss_weight in cfg . trainer . loss_weight . __dict__ . items ( ) : if loss_weight > 0 : self . weights [ loss_name ] = loss_weight pass
r"""Initialize loss terms.
r " " " Initialize loss terms .
r"""Initialize loss terms. In FUNIT, we have several loss terms
        including the GAN loss, the image reconstruction loss, the feature
        matching loss, and the gradient penalty loss.

        Args:
            cfg (obj): Global configuration.
        """ # self.criteria['dis_basic'] = nn.BCEWithLogitsLoss()

self
cfg
None