The following is a link to a blog post that explains Justin's code and how it (properly) implements the Gatys paper "A Neural Algorithm of Artistic Style". In particular, the ContentLoss:updateOutput, ContentLoss:updateGradInput, StyleLoss:updateOutput, StyleLoss:updateGradInput, and TVLoss:updateGradInput methods are explained and shown to match what is in the Gatys paper.
The following is a link to a blog post that explains Justin's code and how it (properly) implements the Gatys paper "A Neural Algorithm of Artistic Style". In particular, the ContentLoss:updateOutput, ContentLoss:updateGradInput, StyleLoss:updateOutput, StyleLoss:updateGradInput, and TVLoss:updateGradInput methods are explained and shown to match what is in the Gatys paper.
Justin Johnson's Neural Style Torch Implementation Explained
Kudos to Justin for a great torch implementation.