# Week 3 — Exercise 6

**URL:** <https://community.deeplearning.ai/t/week-3-exercise-6/23907>\
**Category:** Improving Deep Neural Networks: Hyperparameter tun\
**Tags:** coursera-platform\
**Created:** [July 28, 2021, 4:35pm UTC](https://community.deeplearning.ai/t/week-3-exercise-6/23907 "2021-07-28T16:35:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hubort](https://avatars.discourse-cdn.com/v4/letter/h/779978/32.png) [@hubort](https://community.deeplearning.ai/u/hubort)\
**Post date:** [July 28, 2021, 4:35pm UTC](https://community.deeplearning.ai/t/week-3-exercise-6/23907/1 "2021-07-28T16:35:50Z")

</div>

Hey there,

I am struggling with this exercise, as I run into the same error over and over again:

> NameError Traceback (most recent call last)  
> in   
> 17 print(“\033[92mAll test passed”)  
> 18  
> —\> 19 compute\_cost\_test(compute\_cost, new\_y\_train )

> NameError: name ‘new\_y\_train’ is not defined

There is no variable new\_y\_train I could modify?  
The code I’m using is the following:

[Removed solution code]

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![nramon](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/nramon/32/129097_2.png) [@nramon](https://community.deeplearning.ai/u/nramon)\
**Post date:** [July 28, 2021, 6:05pm UTC](https://community.deeplearning.ai/t/week-3-exercise-6/23907/2 "2021-07-28T18:05:00Z")

</div>

Hi, @hubort.

`new_y_train` is a global variable defined in exercise 3 (right after `one_hot_matrix_test`). Make sure you ran that cell.

If it’s not there, you may have to [update](https://community.deeplearning.ai/t/how-to-get-a-clean-copy-of-an-assignment-notebook/73) your notebook.

Good luck 🙂

---

<div class="post-metadata">

**Author:** ![hubort](https://avatars.discourse-cdn.com/v4/letter/h/779978/32.png) [@hubort](https://community.deeplearning.ai/u/hubort)\
**Post date:** [July 28, 2021, 9:30pm UTC](https://community.deeplearning.ai/t/week-3-exercise-6/23907/3 "2021-07-28T21:30:06Z")

</div>

Completely right, I oversaw it, but running it results in the following error:  
(see hastebin, for it is 105 lines long)  
[https://hastebin.com/upatekazum.sql](https://hastebin.com/upatekazum.sql)

---

<div class="post-metadata">

**Author:** ![nramon](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/nramon/32/129097_2.png) [@nramon](https://community.deeplearning.ai/u/nramon)\
**Post date:** [July 29, 2021, 7:23am UTC](https://community.deeplearning.ai/t/week-3-exercise-6/23907/5 "2021-07-29T07:23:40Z")

</div>

[This](https://community.deeplearning.ai/t/no-good-solution-for-one-hot-matrix/23409/2) could be problem 🙂

---

<div class="post-metadata">

**Author:** ![hubort](https://avatars.discourse-cdn.com/v4/letter/h/779978/32.png) [@hubort](https://community.deeplearning.ai/u/hubort)\
**Post date:** [July 29, 2021, 8:51am UTC](https://community.deeplearning.ai/t/week-3-exercise-6/23907/6 "2021-07-29T08:51:13Z")

</div>

:’-)  
It’s always so obvious, it hurts.

---

<div class="post-metadata">

**Author:** ![nramon](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/nramon/32/129097_2.png) [@nramon](https://community.deeplearning.ai/u/nramon)\
**Post date:** [July 29, 2021, 9:07am UTC](https://community.deeplearning.ai/t/week-3-exercise-6/23907/7 "2021-07-29T09:07:27Z")

</div>

Been there 😂

Good luck with course 3!
