C4W4 Art Generation - Wrong Value

I’m running getting the wrong values and need help determining if my order of operation is correct:

Here are the two methods that I’ve been trying to compute Content Cost:

Content Cost = reduce_sum( square( subtract(a_C_unrolled, a_G_unrolled))) / (4n_Hn_W*n_C)

and

Content Cost = square(subtract(reduce_sum(a_C_unrolled), reduce_sum(a_G_unrolled))) / (4n_Hn_W*n_C)

Both result in wrong values. Any tips?

JB

Hi jose.butalao,

In case you did not resolve this issue yet: The first method you tried looks ok to me, provided that you used tensorflow methods. If this gives you the wrong values nonetheless, there may be an issue with the code that precedes it.