# Week 3 Assignment: Why there are 2 Dense layers instead of one

**URL:** <https://community.deeplearning.ai/t/week-3-assignment-why-there-are-2-dense-layers-instead-of-one/232162>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [November 18, 2022, 12:25pm UTC](https://community.deeplearning.ai/t/week-3-assignment-why-there-are-2-dense-layers-instead-of-one/232162 "2022-11-18T12:25:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![idoraquel](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/idoraquel/32/31313_2.png) [@idoraquel](https://community.deeplearning.ai/u/idoraquel)\
**Post date:** [November 18, 2022, 12:25pm UTC](https://community.deeplearning.ai/t/week-3-assignment-why-there-are-2-dense-layers-instead-of-one/232162/1 "2022-11-18T12:25:07Z")

</div>

Hey community!  
Could somebody please elaborate why do we need 2 Dense layers instead of just one?  
And why the tanh and relu were chosen as activation functions?  
I tried to find the answer in the papers mentioned throughout the course but failed.

```auto
densor1 = Dense(10, activation = "tanh")
densor2 = Dense(1, activation = "relu")

```

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [November 18, 2022, 4:45pm UTC](https://community.deeplearning.ai/t/week-3-assignment-why-there-are-2-dense-layers-instead-of-one/232162/2 "2022-11-18T16:45:51Z")

</div>

There are two assignments in Week 3. Which one are you asking about?

---

<div class="post-metadata">

**Author:** ![idoraquel](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/idoraquel/32/31313_2.png) [@idoraquel](https://community.deeplearning.ai/u/idoraquel)\
**Post date:** [November 21, 2022, 8:33am UTC](https://community.deeplearning.ai/t/week-3-assignment-why-there-are-2-dense-layers-instead-of-one/232162/3 "2022-11-21T08:33:57Z")

</div>

I believe it is the first assignment, about machine translation
