Pytorch-Tutorials icon indicating copy to clipboard operation
Pytorch-Tutorials copied to clipboard

why returning style loss + style loss?

Open songer1993 opened this issue 8 years ago • 2 comments

I am wondering why style loss + style loss is returned in function closure(). Could you give an explanation?

songer1993 avatar May 02 '17 03:05 songer1993

wow that's a typo! thanks.. correct is to return content_loss+style_loss, I fixed it. but interestingly it works anyway...

alexis-jacq avatar May 02 '17 12:05 alexis-jacq

Probably because each loss already gets back-propagated when doing 'style_score += sl.backward()' and 'content_score += cl.backward()'.

songer1993 avatar May 04 '17 02:05 songer1993