# Sequential Model - Week 4

**URL:** <https://community.deeplearning.ai/t/sequential-model-week-4/25823>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [August 7, 2021, 7:32pm UTC](https://community.deeplearning.ai/t/sequential-model-week-4/25823 "2021-08-07T19:32:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amit-a7](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/amit-a7/32/5723_2.png) [@amit-a7](https://community.deeplearning.ai/u/amit-a7)\
**Post date:** [August 7, 2021, 7:32pm UTC](https://community.deeplearning.ai/t/sequential-model-week-4/25823/1 "2021-08-07T19:32:51Z")

</div>

Stuck at UNQ\_C6 with the AssertionError: Wrong values in attn\_w\_b2. Check the call to self.mha2

mult\_attn\_out2, attn\_weights\_block2 = self.mha2(Q1,enc\_output,enc\_output,padding\_mask, return\_attention\_scores=True

---

<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, 8:55pm UTC](https://community.deeplearning.ai/t/sequential-model-week-4/25823/2 "2021-08-07T20:55:30Z")

</div>

Most likely causes:

- your value for Q1 is incorrect.
- you have modified one of the constructor functions in the DecoderLayer().
- you have modified the create\_kook\_ahead\_mask() function.

---

<div class="post-metadata">

**Author:** ![amit-a7](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/amit-a7/32/5723_2.png) [@amit-a7](https://community.deeplearning.ai/u/amit-a7)\
**Post date:** [August 8, 2021, 8:57am UTC](https://community.deeplearning.ai/t/sequential-model-week-4/25823/3 "2021-08-08T08:57:37Z")

</div>

mult\_attn\_out1, attn\_weights\_block1 = self.mha1(x, x, x, look\_ahead\_mask, return\_attention\_scores=True)  
mult\_attn\_out1 = self.dropout\_ffn(mult\_attn\_out1, training=training)  
Q1 = self.layernorm1(mult\_attn\_out1 + x)

I haven’t modified any constructor functions in the DecodeLayer() and did not modify create\_look\_ahead\_ask() function, so most likely the value for Q1 is incorrect, please review my code .

---

<div class="post-metadata">

**Author:** ![amit-a7](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/amit-a7/32/5723_2.png) [@amit-a7](https://community.deeplearning.ai/u/amit-a7)\
**Post date:** [August 8, 2021, 2:32pm UTC](https://community.deeplearning.ai/t/sequential-model-week-4/25823/4 "2021-08-08T14:32:40Z")

</div>

I solved the problem.
