chaofengc / PSFRGAN

PyTorch codes for "Progressive Semantic-Aware Style Transformation for Blind Face Restoration", CVPR2021
Other
370 stars 68 forks source link

Loss_ss is 0.000 #26

Closed Wangyulin-user closed 3 years ago

Wangyulin-user commented 3 years ago

Hello chaofeng, thank you for your wonderful work. I would like to ask why the Loss_ss is 0 when I trained with my own dataset? The masks I used are not generated by the net_P, and there are only a part of the images have the label masks, for example, my dataset is about brain, and only the tumor part of the brain has label. So could you please explain what's the Loss_ss equals to 0 means? And also the Loss_pcp is 0.

chaofengc commented 3 years ago

Thank you for interest.

BTW: If you only want to calculate style loss for specific region, you need to make further modifications to the RegionStyleLoss class, for example, only use gram matrix for specific label in this function https://github.com/chaofengc/PSFRGAN/blob/c882315c9f1fc91c43d13a709016dd411f73d713/models/loss.py#L192

Wangyulin-user commented 3 years ago

Thank you for your kindly explanation, now I set the region_num as 1 and I got Loss_SS even though it still so small like 0.006. So is there an ideal value for the Loss_ss? In view of it is MSE loss, is 0 the training goal?

chaofengc commented 3 years ago

The value of Loss_SS depends on your data. Similar to other networks, it is usually impossible to reach 0 if you use mini batch stochastic gradient descent.

zhangyunming commented 3 years ago

if use Loss_pcp , the result will be better? and lambda_pcp should be?

chaofengc commented 3 years ago

I tried with perceptual loss, but did not find improvement over visual quality. Perhaps will improve quantitative results. I did not test that.