Is it necessay to keep the gradients when computes the perceptual loss using VGG net?

Hi, there!

I argued with my friends whether it was necessay to keep the gradents of VGG net to obtain the perceptual loss.

loss_total = loss_net + loss_vgg.

I thought there was no use to update the parameters of the VGG net, so there was no reason to keep the gradients.

Any suggestions? Thank you!

Could you link to a reference implementation, which shows the desired behavior?
If I’m not mistaken, the perceptual loss is calculated by using a norm between the intermediate activations between two input images, and summing it to a final loss.
If my understanding is correct, I don’t see where the gradients can be used at this point, as they aren’t calculated yet.

Yes, exactly. Vgg acts as a ruler, we should not change a ruler.

Thanks!