Feature mode -> back to LR fea

This commit is contained in:
James Betker 2020-09-11 13:09:55 -06:00
parent 1086f0476b
commit 50ca17bb0a

View File

@ -72,12 +72,7 @@ class FeatureModel(BaseModel):
def optimize_parameters(self, step): def optimize_parameters(self, step):
self.optimizer_G.zero_grad() self.optimizer_G.zero_grad()
self.fake_H = self.fea_train(self.var_L, interpolate_factor=2)
# grey out the LR image but keep 3 channels.
lr = torch.mean(self.real_H, dim=1, keepdim=True)
lr = lr.repeat(1, 3, 1, 1)
self.fake_H = self.fea_train(lr, interpolate_factor=1)
ref_H = self.net_ref(self.real_H) ref_H = self.net_ref(self.real_H)
l_fea = self.cri_fea(self.fake_H, ref_H) l_fea = self.cri_fea(self.fake_H, ref_H)
l_fea.backward() l_fea.backward()