# Course 4, week 1, Convolution\_model\_Step\_by\_Step\_v1, Exercise 3 - unable to overcome shapes error

**URL:** <https://community.deeplearning.ai/t/course-4-week-1-convolution-model-step-by-step-v1-exercise-3-unable-to-overcome-shapes-error/15235>\
**Category:** Convolutional Neural Networks\
**Tags:** coursera-platform\
**Created:** [June 18, 2021, 2:29pm UTC](https://community.deeplearning.ai/t/course-4-week-1-convolution-model-step-by-step-v1-exercise-3-unable-to-overcome-shapes-error/15235 "2021-06-18T14:29:46Z")\
**Posts on this page:** 1\
**Showing post:** 54

<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:** [May 16, 2023, 5:09pm UTC](https://community.deeplearning.ai/t/course-4-week-1-convolution-model-step-by-step-v1-exercise-3-unable-to-overcome-shapes-error/15235/54 "2023-05-16T17:09:02Z")

</div>

I made the point earlier that you can either use multiplication or addition for handling the stride. Watch this:

```auto
stride = 3

print("Using multiplication")
for h in range(4):
    vert_start = h * stride
    print(f"h {h}, vert_start {vert_start}")

print("Using addition")
vert_start = 0
for h in range(4):
    print(f"h {h}, vert_start {vert_start}")
    vert_start = vert_start + stride

```

Running that gives these results:

```auto
Using multiplication
h 0, vert_start 0
h 1, vert_start 3
h 2, vert_start 6
h 3, vert_start 9
Using addition
h 0, vert_start 0
h 1, vert_start 3
h 2, vert_start 6
h 3, vert_start 9

```

So either method works, but I think the multiplication method is simpler to write and clearer code.

---

_[View the full topic](https://community.deeplearning.ai/t/course-4-week-1-convolution-model-step-by-step-v1-exercise-3-unable-to-overcome-shapes-error/15235)._
