# C1\_W3\_Assignment - bugs and fixes

**URL:** <https://community.deeplearning.ai/t/c1-w3-assignment-bugs-and-fixes/351948>\
**Category:** Linear Algebra for Machine Learning and Data Sc...\
**Tags:** week-module-3\
**Created:** [June 7, 2023, 3:04pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-bugs-and-fixes/351948 "2023-06-07T15:04:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Kusturic](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/ivan_kusturic/32/29279_2.png) [@Ivan\_Kusturic](https://community.deeplearning.ai/u/Ivan_Kusturic)\
**Post date:** [June 7, 2023, 3:04pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-bugs-and-fixes/351948/1 "2023-06-07T15:04:04Z")

</div>

Hi everyone,

Just wanted to bring up an error I encountered in the programming assignment for W3. In the _nn\_model_ function, the _print_ statement for the iteration number and the cost is throwing an error. The error doesn’t effect the tests, it’s just looking ugly 🙂

Also, I think many people have encountered the same problem regarding the matrix multiplication in the _forward\_propagation_ function. You should be using the **dot product** when calculating **W@X + b**. The instructions seem somewhat misleading - Compute `Z` by **multiplying arrays** `w` and `X` , and then adding the vector `b` ."

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [June 7, 2023, 4:41pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-bugs-and-fixes/351948/2 "2023-06-07T16:41:16Z")

</div>

There are two types of matrix multiplication. Understanding Prof Ng’s notational conventions and also understanding the underlying math is essential in disambiguating which was intended. [Here’s a thread](https://community.deeplearning.ai/t/week-2-how-to-decide-to-use-or-np-dot-when-calculating-formula/17467) which goes into those issues in some detail.

---

<div class="post-metadata">

**Author:** ![Ivan\_Kusturic](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/ivan_kusturic/32/29279_2.png) [@Ivan\_Kusturic](https://community.deeplearning.ai/u/Ivan_Kusturic)\
**Post date:** [June 7, 2023, 8:31pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-bugs-and-fixes/351948/3 "2023-06-07T20:31:37Z")

</div>

Hi paulinpaloalto,

It wasn’t understanding of the different matrix multiplications that caused the confusion, at least not in my case. This particular assignment started with a single perceptron. Following the instructions it wasn’t clear that the dot product should be used. It could be assumed that the implemented functions don’t have to be generalised but only to work for a single perceptron version in which case it’s actually a vector and a scalar multiplication.

Just my two cents though. It’s not a critique but an observation.
