# Week1, programming exercise 2, np.int64(A2 \> 0)

**URL:** <https://community.deeplearning.ai/t/week1-programming-exercise-2-np-int64-a2-0/22567>\
**Category:** Improving Deep Neural Networks: Hyperparameter tun\
**Tags:** coursera-platform\
**Created:** [July 22, 2021, 1:59am UTC](https://community.deeplearning.ai/t/week1-programming-exercise-2-np-int64-a2-0/22567 "2021-07-22T01:59:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nay](https://avatars.discourse-cdn.com/v4/letter/n/8e7dd6/32.png) [@Nay](https://community.deeplearning.ai/u/Nay)\
**Post date:** [July 22, 2021, 1:59am UTC](https://community.deeplearning.ai/t/week1-programming-exercise-2-np-int64-a2-0/22567/1 "2021-07-22T01:59:31Z")

</div>

Hello,  
Can someone please explain what np.int64(A2 \> 0) does in the following line of code?  
dZ2 = np.multiply(dA2, np.int64(A2 \> 0))  
This is inside the function backward\_propagation\_with\_regularization.

Thank you,  
Nay

---

<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:** [July 22, 2021, 3:03am UTC](https://community.deeplearning.ai/t/week1-programming-exercise-2-np-int64-a2-0/22567/2 "2021-07-22T03:03:22Z")

</div>

That is just the derivative of the ReLU activation function. Remember that the relevant back propagation formula is:

dZ^{[l]} = dA^{[l]} \* g^{[l]'}(Z^{[l]})

The derivative of ReLU is 0 if Z \leq 0 and 1 if Z \> 0, right? And it works the same if you use A in place of Z there, since A \> 0 if and only if Z \> 0.
