I’ve retrieved dimensions successfully, converted the shape of a_S and a_G from(1,n_H,n_W,n_C) to (n_C,n_H*n_W) , calculated the gram matrices using the predefined function gram_matrix(A) and computed J_style_layer as follow:
J_style_layer = (1 / (4 * n_C**2 * (n_H * n_W)**2)) * tf.reduce_sum(tf.square(tf.subtract(GS, GG)))
this error appears and I can’t understand
"AssertionError Traceback (most recent call last)
Input In [34], in <cell line: 3>()
1 ### you cannot edit this cell
----> 3 compute_layer_style_cost_test(compute_layer_style_cost)
File /tf/W4A2/public_tests.py:57, in compute_layer_style_cost_test(target)
55 assert np.isclose(J_style_layer_GG, 0.0), “Wrong value. compute_layer_style_cost(A, A) must be 0”
56 assert J_style_layer_SG > 0, “Wrong value. compute_layer_style_cost(A, B) must be greater than 0 if A != B”
—> 57 assert np.isclose(J_style_layer_SG, 14.01649), “Wrong value.”
59 print(“J_style_layer = " + str(J_style_layer_SG))
60 print(”\033[92mAll tests passed")
AssertionError: Wrong value."