Skip to content

Commit

Permalink
feat: giving option that percep can be zero for Danbooru percp
Browse files Browse the repository at this point in the history
  • Loading branch information
HikariDawn777 committed Mar 28, 2024
1 parent 7d67eb1 commit eb926e0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions train_code/train_grlgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit eb926e0

Please sign in to comment.