# Week2- programming assignment- mobile net- activation funcation

**URL:** <https://community.deeplearning.ai/t/week2-programming-assignment-mobile-net-activation-funcation/53110>\
**Category:** Convolutional Neural Networks\
**Tags:** coursera-platform\
**Created:** [October 21, 2021, 3:25pm UTC](https://community.deeplearning.ai/t/week2-programming-assignment-mobile-net-activation-funcation/53110 "2021-10-21T15:25:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aroonima](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@Aroonima](https://community.deeplearning.ai/u/Aroonima)\
**Post date:** [October 21, 2021, 3:25pm UTC](https://community.deeplearning.ai/t/week2-programming-assignment-mobile-net-activation-funcation/53110/1 "2021-10-21T15:25:43Z")

</div>

Hi, For the alpaca model , the activation function used is ‘linear’. Is there any reason why we have not used ‘sigmoid’?

---

<div class="post-metadata">

**Author:** ![jonaslalin](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/jonaslalin/32/63_2.png) [@jonaslalin](https://community.deeplearning.ai/u/jonaslalin)\
**Post date:** [November 2, 2021, 9:00pm UTC](https://community.deeplearning.ai/t/week2-programming-assignment-mobile-net-activation-funcation/53110/2 "2021-11-02T21:00:11Z")

</div>

Because

```auto
model2.compile(optimizer=tf.keras.optimizers.Adam(lr=base_learning_rate),
               loss=tf.keras.losses.BinaryCrossentropy(from_logits=True),
               metrics=['accuracy'])

```

we specify from\_logits=True here, which effectively means you end up using the sigmoid activation function in the last layer, but it is optimized.

---

<div class="post-metadata">

**Author:** ![Aroonima](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@Aroonima](https://community.deeplearning.ai/u/Aroonima)\
**Post date:** [November 3, 2021, 10:32am UTC](https://community.deeplearning.ai/t/week2-programming-assignment-mobile-net-activation-funcation/53110/3 "2021-11-03T10:32:25Z")

</div>

Yes, I understood it now. Thanks!
