def __init__(self, args, loader, my_model, my_loss, ckp):
    self.args = args
    self.scale = args.scale
    self.ckp = ckp
    self.loader_train = loader.loader_train
    self.loader_test = loader.loader_test
    self.model = my_model
    self.loss = my_loss
    self.optimizer = utility.make_optimizer(args, self.model)
    self.flag_ae_loss = (True if (args.loss.lower().find('ae') >= 0) else False)
    if (self.args.precision == 'amp'):
        self.scaler = torch.cuda.amp.GradScaler()
    if (self.args.load != ''):
        self.optimizer.zero_grad()
        self.optimizer.step()
        self.optimizer.load(ckp.dir, epoch=len(ckp.log))
    self.error_last = 100000000.0
def __init__(self, args, loader, my_model, my_loss, ckp):
    self.args = args
    self.scale = args.scale
    self.ckp = ckp
    self.loader_train = loader.loader_train
    self.loader_test = loader.loader_test
    self.model = my_model
    self.loss = my_loss
    self.optimizer = utility.make_optimizer(args, self.model)
    self.flag_ae_loss = (True if (args.loss.lower().find('ae') >= 0) else False)
    if (self.args.precision == 'amp'):
        self.scaler = torch.cuda.amp.GradScaler()
    if (self.args.load != ):
        self.optimizer.zero_grad()
        self.optimizer.step()
        self.optimizer.load(ckp.dir, epoch=len(ckp.log))
    self.error_last = 100000000.0