# Week 1\_A2\_Exercise 4

**URL:** <https://community.deeplearning.ai/t/week-1-a2-exercise-4/415398>\
**Category:** Improving Deep Neural Networks: Hyperparameter tun\
**Tags:** coursera-platform\
**Created:** [August 12, 2023, 6:30am UTC](https://community.deeplearning.ai/t/week-1-a2-exercise-4/415398 "2023-08-12T06:30:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JasonL](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@JasonL](https://community.deeplearning.ai/u/JasonL)\
**Post date:** [August 12, 2023, 6:30am UTC](https://community.deeplearning.ai/t/week-1-a2-exercise-4/415398/1 "2023-08-12T06:30:59Z")

</div>

![image](https://global.discourse-cdn.com/dlai/original/3X/8/7/87cdefd3820bde0aa487d982a868c1c9290d5f97.png)

Hi, could anyone tell me what this “np.int64(A2 \> 0)” in the first line is doing?

(This is computing gradients in back propagation)

Thanks.

---

<div class="post-metadata">

**Author:** ![saifkhanengr](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/saifkhanengr/32/152858_2.png) [@saifkhanengr](https://community.deeplearning.ai/u/saifkhanengr)\
**Post date:** [August 12, 2023, 6:40am UTC](https://community.deeplearning.ai/t/week-1-a2-exercise-4/415398/2 "2023-08-12T06:40:04Z")

</div>

np.int64 converts all Boolean values (True/False) to integers of 1 or 0.

---

<div class="post-metadata">

**Author:** ![JasonL](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@JasonL](https://community.deeplearning.ai/u/JasonL)\
**Post date:** [August 12, 2023, 6:45am UTC](https://community.deeplearning.ai/t/week-1-a2-exercise-4/415398/3 "2023-08-12T06:45:00Z")

</div>

In my understanding, isn’t A2 already in terms of 0 and 1 from the forward propagation?

Thanks.

---

<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 12, 2023, 7:00am UTC](https://community.deeplearning.ai/t/week-1-a2-exercise-4/415398/4 "2023-08-12T07:00:17Z")

</div>

> [@JasonL](#):
>
> isn’t A2 already in terms of 0 and 1 from the forward propagation?

No, it is not.
