Week 4, Art Generation

Week 4, Art Generation. In compute_layer_style_cost function I am getting 2.9203951, but the correct answer is 14.017805. I am mistaking in reshaping. I am doing like this: a_S = tf.reshape(a_S, [n_C, n_H * n_W]).

Hi Fakhriddin99,

For the reshaping to work correctly, you first want to unroll the height and width correctly. Then, you can adjust the order of the dimensions. See the additional hint. Good luck!

1 Like

Hi Fakhriddin99,

I made the same mistake. Your reshape is correct, but the order of a_S’ dimensions is not, since you don’t want the original order. You need to transpose the original tensor to make dimensions match.