Course 4 // Week 4 // NST Homework: Can content-cost be computed from multi-layers

Hey there,

in the homework, we see that the style-cost is computed with selected layers which are outputs of the pretrained model. Compare to the content-cost which is based on the last output.


  1. Can the content-cost be computed with more than one output?
  2. Can the style-cost be computed with the output which is used by content-cost?

(I mean, both are not the problem of math calculation, but why not in the homework? :face_with_monocle:)

Hi Chris.X,

On the basis of the original paper here, it would seem that as long as you can construct a correct content and style representation, you can use any layer(s) you want.

In the paper you can read why choices are made to use a high level layer for content (retain high-level content but loose detailed pixel information which allows for the introduction of style elements), and why several layers are chosen for style (to find correlating features while loosing content information). The assignment simply follows these ideas of the original paper.