474ed3789d19fd1bdf40a7365a5d196e118132c0,codes/models/SR_model.py,SRModel,__init__,#SRModel#,13

Before Change


            self.l_pix_w = train_opt["pixel_weight"]

            // optimizers
            self.optimizers = []
            wd_G = train_opt["weight_decay_G"] if train_opt["weight_decay_G"] else 0
            optim_params = []
            for k, v in self.netG.named_parameters():  // can optimize for a part of the model
                if v.requires_grad:
                    optim_params.append(v)
                else:
                    print("WARNING: params [%s] will not optimize." % k)
            self.optimizer_G = torch.optim.Adam(optim_params,
                                                lr=train_opt["lr_G"], weight_decay=wd_G)
            self.optimizers.append(self.optimizer_G)

            // schedulers
            self.schedulers = []
            if train_opt["lr_scheme"] == "MultiStepLR":
                for optimizer in self.optimizers:
                    self.schedulers.append(lr_scheduler.MultiStepLR(optimizer, \
                        train_opt["lr_steps"], train_opt["lr_gamma"]))

After Change


            elif loss_type == "l2":
                self.cri_pix = nn.MSELoss().to(self.device)
            else:
                raise NotImplementedError("Loss type [{:s}] is not recognized.".format(loss_type))
            self.l_pix_w = train_opt["pixel_weight"]

            // optimizers
            wd_G = train_opt["weight_decay_G"] if train_opt["weight_decay_G"] else 0
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 9

Instances


Project Name: xinntao/BasicSR
Commit Name: 474ed3789d19fd1bdf40a7365a5d196e118132c0
Time: 2018-09-09
Author: wxt1994@126.com
File Name: codes/models/SR_model.py
Class Name: SRModel
Method Name: __init__


Project Name: xinntao/BasicSR
Commit Name: 474ed3789d19fd1bdf40a7365a5d196e118132c0
Time: 2018-09-09
Author: wxt1994@126.com
File Name: codes/models/SRGAN_model.py
Class Name: SRGANModel
Method Name: __init__


Project Name: xinntao/BasicSR
Commit Name: 474ed3789d19fd1bdf40a7365a5d196e118132c0
Time: 2018-09-09
Author: wxt1994@126.com
File Name: codes/models/SRRaGAN_model.py
Class Name: SRRaGANModel
Method Name: __init__


Project Name: xinntao/BasicSR
Commit Name: 474ed3789d19fd1bdf40a7365a5d196e118132c0
Time: 2018-09-09
Author: wxt1994@126.com
File Name: codes/models/SFTGAN_ACD_model.py
Class Name: SFTGAN_ACD_Model
Method Name: __init__


Project Name: xinntao/BasicSR
Commit Name: 474ed3789d19fd1bdf40a7365a5d196e118132c0
Time: 2018-09-09
Author: wxt1994@126.com
File Name: codes/models/SR_model.py
Class Name: SRModel
Method Name: __init__