PConv-Keras icon indicating copy to clipboard operation
PConv-Keras copied to clipboard

the range of loss when training

Open laolongboy opened this issue 6 years ago • 7 comments

I want to know the range of loss when training, thx

laolongboy avatar Jul 16 '18 10:07 laolongboy

For my original implementation, the input image and target image are normalized to be in the range of [-1,1]; for the input for VGG based loss, it is also in that range. Thus, the loss won't be too big. For my case, it is between [0, 3].

liuguilin1225 avatar Jul 20 '18 18:07 liuguilin1225

why my training loss is so big ,that is begined with about 2000000...

dianxin556 avatar Nov 27 '18 08:11 dianxin556

@dianxin556 the L1 loss should be size-averaged.

liuguilin1225 avatar Jan 04 '19 00:01 liuguilin1225

@liuguilin1225 In the paper, you used a VGG model trained on pytorch which requires the image pre-processing you point to on your website, namely this:

  1. dividing by 255,
  2. subtracting a per-channel mean,
  3. dividing by a per-channel std.

It does not seem to lead to the [-1,1] range but rather to [-2.12, 2.25], [-2.04, 2.43] and [-1.80, 2.64] for the R, G and B channels. Am I missing something or did you use another pre-processing?

ezavarygin avatar Feb 23 '19 14:02 ezavarygin

@ezavarygin sorry for the late reply. I mainly followed the link you posted, I guess that is how the original VGG model was trained. https://github.com/pytorch/examples/blob/master/imagenet/main.py#L198

It doesn't necessarily to be in [-1, 1]. Especially for computing perceptual loss and style loss, we just need to make sure the two compared images are using the same preprocessing scheme.

liuguilin1225 avatar Feb 28 '19 19:02 liuguilin1225

I've ported the VGG16 model from pytorch to keras now, and also updated the PConv2d layer to use local normalization. Loss ranges should be significantly different now, eh?

MathiasGruber avatar Mar 01 '19 12:03 MathiasGruber

I'm facing the same problem while training from scratch the loss starts at [10,9] the model gives brown images for the initial epoch. So I started finetuning with the provided imagenet weights but the loss still seems to start at [10,9] is this expected behaviour ? Also is the hyperparams of the fixmyphoto.ai same as in the notebook, because i'm getting good results with the website, but with the model I'm not getting similar results.

suvojit-0x55aa avatar Aug 13 '19 09:08 suvojit-0x55aa