# C4\_W2 Model working well but not agreeing with scaled dot prod. attention values

**URL:** <https://community.deeplearning.ai/t/c4-w2-model-working-well-but-not-agreeing-with-scaled-dot-prod-attention-values/649665>\
**Category:** NLP with Attention Models\
**Created:** [June 18, 2024, 9:04pm UTC](https://community.deeplearning.ai/t/c4-w2-model-working-well-but-not-agreeing-with-scaled-dot-prod-attention-values/649665 "2024-06-18T21:04:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mb009](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@mb009](https://community.deeplearning.ai/u/mb009)\
**Post date:** [June 18, 2024, 9:04pm UTC](https://community.deeplearning.ai/t/c4-w2-model-working-well-but-not-agreeing-with-scaled-dot-prod-attention-values/649665/1 "2024-06-18T21:04:39Z")

</div>

I completed the assignment and the model is working pretty well but the first exercise on implementing the scaled dot prod. attention function is not quite giving me your expected values - my values shown below. I implemented the code in a very similar way to the corresponding lab + happy to share privately. Not sure what why my values are not agreeing? Can’t tag this as requested btw. and also checked out similar posts …

Output:  
[[[1. 0.67]  
[0.67 0.67]  
[0.75 0.5]]]

Attention weigths:  
[[[0. 0.33 0. 0.33 0.33]  
[0.33 0. 0. 0.33 0.33]  
[0.25 0.25 0. 0.25 0.25]]]

---

<div class="post-metadata">

**Author:** ![gent.spah](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/gent.spah/32/136423_2.png) [@gent.spah](https://community.deeplearning.ai/u/gent.spah)\
**Post date:** [June 19, 2024, 6:49am UTC](https://community.deeplearning.ai/t/c4-w2-model-working-well-but-not-agreeing-with-scaled-dot-prod-attention-values/649665/2 "2024-06-19T06:49:35Z")

</div>

Its probably because something wrong with your code, send it on private to me I will check it!
