# C4W2 assignment exercise 1 scaled dot-product attention | wrong output values

**URL:** <https://community.deeplearning.ai/t/c4w2-assignment-exercise-1-scaled-dot-product-attention-wrong-output-values/615442>\
**Category:** NLP with Attention Models\
**Tags:** week-module-2\
**Created:** [April 23, 2024, 8:49pm UTC](https://community.deeplearning.ai/t/c4w2-assignment-exercise-1-scaled-dot-product-attention-wrong-output-values/615442 "2024-04-23T20:49:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arthur\_tainmont](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@arthur\_tainmont](https://community.deeplearning.ai/u/arthur_tainmont)\
**Post date:** [April 23, 2024, 8:49pm UTC](https://community.deeplearning.ai/t/c4w2-assignment-exercise-1-scaled-dot-product-attention-wrong-output-values/615442/1 "2024-04-23T20:49:54Z")

</div>

I think I implemented the function ‘scaled\_dot\_product\_attention’ correctly. Still I get wrong outputs for unknown reason.

![Screenshot 2024-04-23 at 22.48.03](https://global.discourse-cdn.com/dlai/original/3X/1/8/186a23b054286c9db0361266daa1b54f171b6b1a.png)

![Screenshot 2024-04-23 at 22.49.17](https://global.discourse-cdn.com/dlai/original/3X/8/4/84dc83f6f0ee0a977421bfac9d64e3db0a5a4928.png)

Thank you for helping me.

---

<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:** [April 24, 2024, 4:36am UTC](https://community.deeplearning.ai/t/c4w2-assignment-exercise-1-scaled-dot-product-attention-wrong-output-values/615442/2 "2024-04-24T04:36:18Z")

</div>

Send me the code on a private message, I could compare them!

---

<div class="post-metadata">

**Author:** ![arthur\_tainmont](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@arthur\_tainmont](https://community.deeplearning.ai/u/arthur_tainmont)\
**Post date:** [April 24, 2024, 8:39am UTC](https://community.deeplearning.ai/t/c4w2-assignment-exercise-1-scaled-dot-product-attention-wrong-output-values/615442/3 "2024-04-24T08:39:25Z")

</div>

I did thank you for your help

---

<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:** [April 24, 2024, 9:59am UTC](https://community.deeplearning.ai/t/c4w2-assignment-exercise-1-scaled-dot-product-attention-wrong-output-values/615442/4 "2024-04-24T09:59:02Z")

</div>

I replied to you with your mistakes but try to understand from the instructions why there are so!
