# W3\_A1\_Ex-6\_backward\_propagation \[AssertionError: Wrong values for dW1\]

**URL:** <https://community.deeplearning.ai/t/w3-a1-ex-6-backward-propagation-assertionerror-wrong-values-for-dw1/66727>\
**Category:** Neural Networks and Deep Learning\
**Tags:** coursera-platform\
**Created:** [November 20, 2021, 6:19pm UTC](https://community.deeplearning.ai/t/w3-a1-ex-6-backward-propagation-assertionerror-wrong-values-for-dw1/66727 "2021-11-20T18:19:31Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [November 20, 2021, 7:40pm UTC](https://community.deeplearning.ai/t/w3-a1-ex-6-backward-propagation-assertionerror-wrong-values-for-dw1/66727/3 "2021-11-20T19:40:14Z")

</div>

Yes, my last theory turns out to be right: you can check by printing _A1_ and _np.tanh(Z1)_ and you’ll see they are the same for the test case you can see in the notebook, but not for the test case in the file _public\_tests.py_. Here are the first few lines of the test routine:

```auto
def backward_propagation_test(target):
    np.random.seed(1)
    X = np.random.randn(3, 7)
    Y = (np.random.randn(1, 7) > 0)
    parameters = {'W1': np.random.randn(9, 3),
         'W2': np.random.randn(1, 9),
         'b1': np.array([[0.], [0.], [0.], [0.], [0.], [0.], [0.], [0.], [0.]]),
         'b2': np.array([[0.]])}

    cache = {'A1': np.random.randn(9, 7),
         'A2': np.random.randn(1, 7),
         'Z1': np.random.randn(9, 7),
         'Z2': np.random.randn(1, 7),}

```

So you can see that there is no mathematical relationship between Z1 and A1 in the cache for that test case. You could argue this is bogus, but why not just use the A1 value? It’s easier (and more efficient at runtime) to write the code that way in any case.

---

_[View the full topic](https://community.deeplearning.ai/t/w3-a1-ex-6-backward-propagation-assertionerror-wrong-values-for-dw1/66727)._
