Week 4 Encoder Wrong Values case 1

Hi,
I can’t find my mistake in

# START CODE HERE
        # mentor edit: code removed

I always get

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-71-68aa9b8f5815> in <module>
      1 # UNIT TEST
----> 2 Encoder_test(Encoder)

~/work/W4A1/public_tests.py in Encoder_test(target)
    124                         [[-0.4612937 ,  1.0697356 , -1.4127715 ,  0.8043293 ],
    125                          [ 0.27027237,  0.28793618, -1.6370889 ,  1.0788803 ],
--> 126                          [ 1.2370994 , -1.0687275 , -0.8945037 ,  0.7261319 ]]]), "Wrong values case 1"
    127 
    128     encoderq_output = encoderq(x, True, np.array([[[[1., 1., 1.]]], [[[1., 1., 0.]]]]))

AssertionError: Wrong values case 1

Can anyone help?

You did not include the training argument in the dropout layer.

Step 4 in the instructions tell you to do this.

thank you, I missed that! but the error is still the same…

I got, it, I missed ‘’:’’ in front of seq_len
x= self.pos_encoding[:, :seq_len, :]

3 Likes