It looks like I passed the first portion of the second assignment but I’m not clear why the denominator of the content cost function has a 4 in the formula? TIA.

So, you are talking about this formula:

J_{content}(C,G) = \frac{1}{4 \times n_H \times n_W \times n_C}\sum _{ \text{all entries}} (a^{(C)} - a^{(G)})^2

I believe, like nH, nW, and nC, factor 4 is used for normalization purposes to ensure that the content cost is within a reasonable range. This 4 can be adjusted to 2 or any other number. Maybe the original authors used 4 but I am not sure about it.

Best,

Saif.

1 Like