This is just a quick note to emphasize that reading the November 2022 discussion for the programming assignment: Art Generation with Neural Style Transfer was of immense help in getting through Exercise 3 where one must compute the layer_style_cost.
I know this post doesn’t add anything useful for those with a lot of user group experience. But for those, like me, who are just getting familiar with the user group I thought this post might be useful.
Like others I was getting an answer of 2.9203947 instead of the correct answer; 14.017805.
After reading the posts I computed the transposes of a_S and a_G and then performed the reshapes - BEFORE computing the gram matrices. I then got the correct answer of 14.017805.
I went back and looked at the a_S and a-G arrays with and without preceding them with the transpose and found that while they had the same shape the numbers were very different. I still need to cogitate a lot more to get a full understanding but I’m working on that.