9ba91fa13cbb1e7bc4069e46469b34abb5ca4869,models/pix2pix_model.py,Pix2PixModel,initialize,#Pix2PixModel#Any#,12

Before Change


        if self.isTrain:
            self.fake_AB_pool = ImagePool(opt.pool_size)
            // define loss functions
            self.criterionGAN = networks.GANLoss(use_lsgan=not opt.no_lsgan, tensor=self.Tensor)
            self.criterionL1 = torch.nn.L1Loss()

            // initialize optimizers
            self.schedulers = []

After Change


    def name(self):
        return "Pix2PixModel"

    def initialize(self, opt):
        BaseModel.initialize(self, opt)
        self.isTrain = opt.isTrain
        // specify the training losses you want to print out. The program will call base_model.get_current_losses
        self.loss_names = ["G_GAN", "G_L1", "D_real", "D_fake"]
        // specify the images you want to save/display. The program will call base_model.get_current_visuals
        self.visual_names = ["real_A", "fake_B", "real_B"]
        // specify the models you want to save to the disk. The program will call base_model.save_networks and base_model.load_networks
        if self.isTrain:
            self.model_names = ["G", "D"]
        else:  // during test time, only load Gs
            self.model_names = ["G"]
        // load/define networks
        self.netG = networks.define_G(opt.input_nc, opt.output_nc, opt.ngf,
                                      opt.which_model_netG, opt.norm, not opt.no_dropout, opt.init_type, self.gpu_ids)

        if self.isTrain:
            use_sigmoid = opt.no_lsgan
            self.netD = networks.define_D(opt.input_nc + opt.output_nc, opt.ndf,
                                          opt.which_model_netD,
                                          opt.n_layers_D, opt.norm, use_sigmoid, opt.init_type, self.gpu_ids)

        if self.isTrain:
            self.fake_AB_pool = ImagePool(opt.pool_size)
            // define loss functions
            self.criterionGAN = networks.GANLoss(use_lsgan=not opt.no_lsgan).to(self.device)
            self.criterionL1 = torch.nn.L1Loss()

            // initialize optimizers
            self.schedulers = []
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 7

Instances


Project Name: richzhang/colorization-pytorch
Commit Name: 9ba91fa13cbb1e7bc4069e46469b34abb5ca4869
Time: 2018-05-22
Author: tongzhou.wang.1994@gmail.com
File Name: models/pix2pix_model.py
Class Name: Pix2PixModel
Method Name: initialize


Project Name: junyanz/pytorch-CycleGAN-and-pix2pix
Commit Name: 9ba91fa13cbb1e7bc4069e46469b34abb5ca4869
Time: 2018-05-22
Author: tongzhou.wang.1994@gmail.com
File Name: models/pix2pix_model.py
Class Name: Pix2PixModel
Method Name: initialize


Project Name: junyanz/pytorch-CycleGAN-and-pix2pix
Commit Name: 9ba91fa13cbb1e7bc4069e46469b34abb5ca4869
Time: 2018-05-22
Author: tongzhou.wang.1994@gmail.com
File Name: models/cycle_gan_model.py
Class Name: CycleGANModel
Method Name: initialize


Project Name: Zhaoyi-Yan/Shift-Net_pytorch
Commit Name: 8f6a6f153781d0908fb0904349aae844494026ea
Time: 2018-12-03
Author: yanzhaoyi@outlook.com
File Name: models/shiftnet_model.py
Class Name: ShiftNetModel
Method Name: initialize