# Week 2 - Emojify - Emoji\_v3a

**URL:** <https://community.deeplearning.ai/t/week-2-emojify-emoji-v3a/12252>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [June 6, 2021, 1:53pm UTC](https://community.deeplearning.ai/t/week-2-emojify-emoji-v3a/12252 "2021-06-06T13:53:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![quoctin](https://avatars.discourse-cdn.com/v4/letter/q/ac91a4/32.png) [@quoctin](https://community.deeplearning.ai/u/quoctin)\
**Post date:** [June 6, 2021, 1:53pm UTC](https://community.deeplearning.ai/t/week-2-emojify-emoji-v3a/12252/1 "2021-06-06T13:53:08Z")

</div>

I was able to create a model Emojify\_V2 that passes all unit tests.  
In Section 2.5, that model can fit the training set with accuracy ~100%. However, the trained model only got 69% accuracy on the test set. According to the guideline, I should get 80%-90%. Did I make anything wrong?

---

<div class="post-metadata">

**Author:** ![ccc888](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@ccc888](https://community.deeplearning.ai/u/ccc888)\
**Post date:** [June 6, 2021, 9:58pm UTC](https://community.deeplearning.ai/t/week-2-emojify-emoji-v3a/12252/2 "2021-06-06T21:58:45Z")

</div>

Did you set embedding layer ‘trainable’ to ‘False’?  
I found that without doing that will also pass the test but result in poor performance.

---

<div class="post-metadata">

**Author:** ![quoctin](https://avatars.discourse-cdn.com/v4/letter/q/ac91a4/32.png) [@quoctin](https://community.deeplearning.ai/u/quoctin)\
**Post date:** [June 7, 2021, 9:38am UTC](https://community.deeplearning.ai/t/week-2-emojify-emoji-v3a/12252/3 "2021-06-07T09:38:40Z")

</div>

Thank you for your response. I set trainable=False already in the function `pretrained_embedding_layer()` . The total trainable params printed from model summary is also coherent with the guidelines. I tried with different batch sizes and number of epochs, but the best test accuracy I could get is only 73%.

---

<div class="post-metadata">

**Author:** ![ccc888](https://avatars.discourse-cdn.com/v4/letter/c/8797f3/32.png) [@ccc888](https://community.deeplearning.ai/u/ccc888)\
**Post date:** [June 7, 2021, 12:16pm UTC](https://community.deeplearning.ai/t/week-2-emojify-emoji-v3a/12252/4 "2021-06-07T12:16:58Z")

</div>

Did you use softmax in the activation layer? I found that using other activations also pass the test and will result in poor performance. I don’t think the grader will catch all the errors so the best way is to check the code carefully step by step.

---

<div class="post-metadata">

**Author:** ![MasakiEguchi](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@MasakiEguchi](https://community.deeplearning.ai/u/MasakiEguchi)\
**Post date:** [August 7, 2021, 11:02pm UTC](https://community.deeplearning.ai/t/week-2-emojify-emoji-v3a/12252/5 "2021-08-07T23:02:31Z")

</div>

I have the same issue. I set trainable = False in the earlier part of the code, and also used ‘softmax’ activation function. Like quoctin, I also tried different batch size and epochs, but the result were 75%. It appears that the model is overfitting to the training set, because I see accuracy of 1.0 near the end of the training. I tried to change the dropout, but the code test did not allow me to change that part.  
I wonder if I am doing something wrong in the code somewhere, or this is the highest figure I could get given the restriction of the parameter setting in the jupyter notebook.

---

<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:** [August 7, 2021, 11:51pm UTC](https://community.deeplearning.ai/t/week-2-emojify-emoji-v3a/12252/6 "2021-08-07T23:51:57Z")

</div>

Do not change any of those parameters. They are already correct.

There is an error in your code.
