In Assignment 2,
I’ve executed all previous exercises and they all tested OK.
In Exercise 3, compute_layer_style_cost:
J_style_layer_GG == 0.0 <-- OK
J_style_layer_SG > 0 <-- OK
J_style_layer_SG == 4613.86084 <-- WRONG VALUE
Tensor shapes look all ok:
A_G, A_S: (1, 4, 4, 3) --> (3, 16)
GS, GG: (3, 3)
The first test case goes OK, so
compute_layer_style_cost(a_G, a_G) == 0.0
The second one fails:
compute_layer_style_cost(a_S, a_G) == 4613.86084
These are the intermediate tensor-values I get:
a_S_reshaped:
[[ -3.404881 -2.51863146 1.35123134. ... 0.19823879 1.3253293 -0.415262461 ]
[ 7.18300676 -3.89868879 0.186958492 ... 7.45242786 6.35230541 0.583993 ]
[ 2.53457594 -2.92448449 -1.23262477 ... 3.71869111 5.7392211 -2.00458574 ]]
a_G_reshaped:
[[ 2.61235142 6.34622669 -2.05688524 ... -3.84423065 4.48628378 -3.23159838 ]
[ -3.35208321 3.84704041 -3.14899445 ... 6.22979736 -2.21240115 -5.59646845 ]
[ 0.747618556 -0.95714581 -4.00773525 ... 2.82066154 -4.48117828 3.43387413 ]]
GS:
[[ 112.321625 37.0738297 -1.95214272 ]
[ 37.0738297 352.194031 116.885025 ]
[ -1.95214272 116.885025 136.679352 ]]
GG:
[[ 277.302155 1.89707661 84.0645676 ]
[ 1.89707661 139.898712 -1.18903875 ]
[ 84.0645676 -1.18903875 245.052292 ]]
And finally, I get the wrong result value:
J_style_layer_SG == 4613.86084
The formula for style-Cost also seems fine, and the code of honor asks not to post it here.
I can’t tell if previous matrixes are ok or not, but all test cases work up to there, and shapes are OK
Can someone help me find where’s the issue?