I’m getting the following error. Can someone help me with my mask?
ERROR:
q [[1. 0. 1. 1.]
[0. 1. 1. 1.]
[1. 0. 0. 1.]]
matmul_qk tf.Tensor(
[[2. 3. 1. 1.]
[2. 2. 2. 1.]
[2. 2. 0. 1.]], shape=(3, 4), dtype=float32)
dk 4
scaled attention logits tf.Tensor(
[[1. 1.5 0.5 0.5]
[1. 1. 1. 0.5]
[1. 1. 0. 0.5]], shape=(3, 4), dtype=float32)
attention weights tf.Tensor(
[[0.2589478 0.42693272 0.15705977 0.15705977]
[0.2772748 0.2772748 0.2772748 0.16817567]
[0.33620113 0.33620113 0.12368149 0.2039163 ]], shape=(3, 4), dtype=float32)
q [[1. 0. 1. 1.]
[0. 1. 1. 1.]
[1. 0. 0. 1.]]
matmul_qk tf.Tensor(
[[2. 3. 1. 1.]
[2. 2. 2. 1.]
[2. 2. 0. 1.]], shape=(3, 4), dtype=float32)
dk 4
scaled attention logits tf.Tensor(
[[1. 1.5 0.5 0.5]
[1. 1. 1. 0.5]
[1. 1. 0. 0.5]], shape=(3, 4), dtype=float32)
attention weights tf.Tensor(
[[[0. 0. 1. 0.]
[0. 0. 1. 0.]
[0. 0. 1. 0.]]], shape=(1, 3, 4), dtype=float32)
AssertionError Traceback (most recent call last)
in
1 # UNIT TEST
----> 2 scaled_dot_product_attention_test(scaled_dot_product_attention)
~/work/W4A1/public_tests.py in scaled_dot_product_attention_test(target)
73 assert np.allclose(weights, [[0.30719590187072754, 0.5064803957939148, 0.0, 0.18632373213768005],
74 [0.3836517333984375, 0.3836517333984375, 0.0, 0.2326965481042862],
—> 75 [0.3836517333984375, 0.3836517333984375, 0.0, 0.2326965481042862]]), “Wrong masked weights”
76 assert np.allclose(attention, [[0.6928040981292725, 0.18632373213768005],
77 [0.6163482666015625, 0.2326965481042862],
AssertionError: Wrong masked weights