From eb926e0af2530e35b135a46fbe61c279870c1bdc Mon Sep 17 00:00:00 2001 From: HikariDawn777 Date: Thu, 28 Mar 2024 11:50:39 -0400 Subject: [PATCH] feat: giving option that percep can be zero for Danbooru percp --- train_code/train_grlgan.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/train_code/train_grlgan.py b/train_code/train_grlgan.py index 3680370..cb563f6 100644 --- a/train_code/train_grlgan.py +++ b/train_code/train_grlgan.py @@ -116,9 +116,12 @@ def calculate_loss(self, gen_hr, imgs_hr): # Generator perceptual loss: generated vs. perceptual - l_g_percep_danbooru = self.cri_danbooru_perceptual(gen_hr, imgs_hr) l_g_percep_vgg = self.cri_vgg_perceptual(gen_hr, imgs_hr) - l_g_percep = l_g_percep_danbooru + l_g_percep_vgg + l_g_percep = l_g_percep_vgg + # For the optional Anime Perceputla Loss + if self.options["danbooru_perceptual_loss_weight"] != 0.0: + l_g_percep_danbooru = self.cri_danbooru_perceptual(gen_hr, imgs_hr) + l_g_percep += l_g_percep_danbooru self.generator_loss += l_g_percep self.weight_store["perceptual_loss"] = l_g_percep