One thing to note is that the train_step function is stateful: you canāt just run the test cell multiple times. If you want consistent results, you have to start by running the train_step cell itself.
Your values are actually relatively close. It could be different rounding behavior caused by numerical stability issues. It might be worth having a look at this thread.
The grader says that it is wrong.
I can run everything and even generate fine pictures.
It is a little hard to know where the error is as i get no error message.
you need to share screenshot of your submission grade where it provides information about the reason why it failed, click on show grader output and then take screenshot.
Code Cell UNQ_C1: Function ācompute_content_costā is correct.
Code Cell UNQ_C2: Function āgram_matrixā is correct.
Code Cell UNQ_C3: Function ācompute_layer_style_costā is correct.
Code Cell UNQ_C4: Function ātotal_costā is correct.
Code Cell UNQ_C5: Function ātrain_stepā is incorrect. Check implementation.
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors.
To close the loop on the public thread, there was a bug in train_step. The logic used a_S as the input image for both the style cost and the content cost. Probably a classic ācopy/pasteā error.
The scarier point is that the tests in the notebook do not catch this error, although the grader does.