Week 4 Art_Generation_with_Neural_Style_Transfer Exercise 3 - compute_layer_style_cost

Hello, @metin_erturkler,

Your formula looks fine, and I assure you that the expected value is correct.

The problem likely lied in your code to compute a_S and a_G. In fact, you must use both tf.transpose and tf.reshape to do the job instead of just the latter, because the job requires you to reorder the dimensions. While reshape can change the shape of the tensor, reordering requires transpose. Mentor Paul has explained it in a link in this post.

Cheers,
Raymond

3 Likes