Hi all
In this exercise, when I calculate J_style_layer = (1/(4*(n_C)**2 *(n_H * n_W)*2)) tf.reduce_sum(tf.square(tf.subtract(GG,GS))), it is all right. However, if I replace **2 with np.square() which is really a common alternative to **2, I got a Unexpected cost for epoch 0 error in the final excercise. In addition, the np.square() methodcan pass the local test for ex3.
Can anyone tell me why the np.square() alternative produces the error in the final exercise?
Thanks
That should work, but you have to be really careful with integer versus floating point arithmetic in this section. TF is not as forgiving about doing the right thing with integers when you really meant to do a floating point calculation. Note that all the n_C, n_H and n_W are python integers to start out with. Try making the 1 there 1. and the 4 as 4. to coerce the expression to floating point and see if that helps.