fast-neural-style icon indicating copy to clipboard operation
fast-neural-style copied to clipboard

Computation issue

Open Pixie8888 opened this issue 4 years ago • 1 comments
trafficstars

Hi, Thanks for sharing code! I have a question regarding computation. It seems that the computation of perceptual loss is much heavier than MSE loss. In my experiment, using perceptual loss will make training much slower and batch size much smaller. Is it normal?

Pixie8888 avatar Aug 20 '21 06:08 Pixie8888

Hi there,

Yes, perceptual loss involves more computation as it takes intermediate activations from different layers, calculates the gram matrices, and back-propagation on the MSE of the differences between two images. It also uses more memory.

But I am not sure how much slower and how much smaller are normal. You can try to reduce the number of layers used in LossNetwork and see if there is a visible difference.

ceshine avatar Aug 21 '21 05:08 ceshine