Week 4 #deep-learning-specialization:dls-course-4 compute_content_cost

I am working on the compute_content_cost function as part of Exercise 1.
I believe I’ve implemented the content cost function as per the instructions.

Removed code

However, I get the error:

Wrong value. Expected 7.0568767, current1354.92041015625

Does anyone know what I might be doing wrong?

@nmamoon check out again the J_content(C, G) formula before the exercise.

You will find that once you get the “sum” you’ll neet to apply an additional factor of

1/(4 x nH x nW x nC)

1 Like

Thank you, totally missed that!

I’m glad you got it now!