# Week # 3, Regularization

**URL:** <https://community.deeplearning.ai/t/week-3-regularization/572629>\
**Category:** Supervised ML: Regression and Classification\
**Tags:** week-module-3\
**Created:** [February 16, 2024, 11:30am UTC](https://community.deeplearning.ai/t/week-3-regularization/572629 "2024-02-16T11:30:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohit\_jaripatke](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rohit\_jaripatke](https://community.deeplearning.ai/u/rohit_jaripatke)\
**Post date:** [February 16, 2024, 11:30am UTC](https://community.deeplearning.ai/t/week-3-regularization/572629/1 "2024-02-16T11:30:32Z")

</div>

Can anyone please explain why the summation i = 1 to n is taken care while finding the derivative? For expression without regularization, the summation i = 1 to m appears in derivative equation but summation i = 1 to n is not appearing. I know derivative of w^2 is 2w but why the summation sign for i = 1 to n has disappeared?

![image](https://global.discourse-cdn.com/dlai/original/3X/8/5/8553364d94be3a7a8f8d2ae0338da526f2394659.png)

---

<div class="post-metadata">

**Author:** ![hackyon](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/hackyon/32/64679_2.png) [@hackyon](https://community.deeplearning.ai/u/hackyon)\
**Post date:** [February 16, 2024, 3:35pm UTC](https://community.deeplearning.ai/t/week-3-regularization/572629/2 "2024-02-16T15:35:46Z")

</div>

The notation here is a little tricky.

The first cost equation (one on top) uses the `w` variable as a matrix, and the summation there refers to summing up all the params inside the `w` matrix. It’s the general equation of cost that applies to all the params (including `w`).

On the other hand, the derivative equation (down below) is with respect to a single param `w_j` inside `w`. The derivative (with respect to `w_j`) of all the other params in `w` that is not `w_j` is 0, and so they sum up to 0. The only term that is not 0 is the derivative of `w_j`, and so that is the only term you are seeing.

---

<div class="post-metadata">

**Author:** ![rohit\_jaripatke](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rohit\_jaripatke](https://community.deeplearning.ai/u/rohit_jaripatke)\
**Post date:** [February 16, 2024, 4:57pm UTC](https://community.deeplearning.ai/t/week-3-regularization/572629/3 "2024-02-16T16:57:36Z")

</div>

Thank you for explanation. I understand better now. 😃
