# Week 12 Discussion Thread

**URL:** <https://community.wandb.ai/t/week-12-discussion-thread/260>\
**Category:** Fastbook Reading Group\
**Created:** [August 26, 2021, 1:07am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260 "2021-08-26T01:07:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![amanarora](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/amanarora/32/59_2.png) [@amanarora](https://community.wandb.ai/u/amanarora)\
**Post date:** [August 26, 2021, 1:07am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/1 "2021-08-26T01:07:13Z")

</div>

This post contains all comments and discussions during our FastBook Week 12 session on convolutions.

[![](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/2X/0/04304e2f335515fe90a7b589e13d4843d115bdb0.jpeg "W&B Fastbook Reading Group — 12. What is a convolution, really?") ](https://www.youtube.com/watch?v=Rmj8OILj7N0)

---

<div class="post-metadata">

**Author:** ![amanarora](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/amanarora/32/59_2.png) [@amanarora](https://community.wandb.ai/u/amanarora)\
**Post date:** [August 26, 2021, 1:07am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/2 "2021-08-26T01:07:55Z")

</div>

# Resources

## Blog posts from last week

- @ravimashru’s posts on building a movie recommender ([part 1](https://ravimashru.dev/blog/2021-08-22-movie-recommender-part-1/) | [part 2](https://ravimashru.dev/blog/2021-08-24-movie-recommender-part-2/))
- @vrc0503’s notes on [collaborative filtering](https://blog.r-c.ai/fastbook/fbw10) (Week 11)
- @VinayakNayak’s post on building an [anime recommendation system](https://elisonsherton.github.io//fastbook/deep%20learning/2021/08/25/fastbook-collaborative-filtering.html)
- @kurianbenoy-aot’s post on [recommender systems](https://kurianbenoy.com/2021-08-25-fastgroup-9/)

## Links from this week

---

<div class="post-metadata">

**Author:** ![vinayak\_nayak](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@vinayak\_nayak](https://community.wandb.ai/u/vinayak_nayak)\
**Post date:** [August 26, 2021, 3:17am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/3 "2021-08-26T03:17:49Z")

</div>

Kurian’s post for recommender systems

> **[Week 10 - Embeddings & Recommender systems, Learning FastBook along with...](https://kurianbenoy.com/2021-08-25-fastgroup-9/)**
>
> Consider the case of buiding a movie recommendation. We usually use collabrative filtering technique to recommend a specific movie to a user of XYZ platform. Yet how will we categorize the movies into various categories? We can do a decent job to...

---

<div class="post-metadata">

**Author:** ![nareshr8](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/nareshr8/32/103_2.png) [@nareshr8](https://community.wandb.ai/u/nareshr8)\
**Post date:** [August 26, 2021, 3:18am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/4 "2021-08-26T03:18:16Z")

</div>

3Blue1Brown Grant Sanderson has a great tutorial about convolution with code (in Julia) in this Youtube video.

https://www.youtube.com/embed/8rrHTtUzyZA?feature=oembed&wmode=opaque&list=PLP8iPy9hna6Q2Kr16aWPOKE0dz9OnsnIJ

For people who are interested.

---

<div class="post-metadata">

**Author:** ![durgaamma2005](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/durgaamma2005/32/117_2.png) [@durgaamma2005](https://community.wandb.ai/u/durgaamma2005)\
**Post date:** [August 26, 2021, 3:21am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/5 "2021-08-26T03:21:34Z")

</div>

is positive number have any significance ? like how dark it is ? if bigger number like 500 is darker than 100?

---

<div class="post-metadata">

**Author:** ![kevinb](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/kevinb/32/36_2.png) [@kevinb](https://community.wandb.ai/u/kevinb)\
**Post date:** [August 26, 2021, 3:23am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/6 "2021-08-26T03:23:26Z")

</div>

Yes, the higher value one would activate more in the case you mentioned. It would output a higher value. Usually pixel values only go from 0 to 255 for ints or 0 to 1 for floats, but besides that, your concept is correct

---

<div class="post-metadata">

**Author:** ![sugilauw](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@sugilauw](https://community.wandb.ai/u/sugilauw)\
**Post date:** [August 26, 2021, 3:26am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/7 "2021-08-26T03:26:45Z")

</div>

For those who wants to reinforce their understanding on how Convolution works, here is a github repo with animation that beautifully visualized convolution operations and transpose convolution operations in CNN.

> **[GitHub - vdumoulin/conv\_arithmetic: A technical report on convolution...](https://github.com/vdumoulin/conv_arithmetic)**
>
> A technical report on convolution arithmetic in the context of deep learning - GitHub - vdumoulin/conv\_arithmetic: A technical report on convolution arithmetic in the context of deep learning

---

<div class="post-metadata">

**Author:** ![nareshr8](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/nareshr8/32/103_2.png) [@nareshr8](https://community.wandb.ai/u/nareshr8)\
**Post date:** [August 26, 2021, 3:26am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/8 "2021-08-26T03:26:50Z")

</div>

There is a cap on the RGB values. The range of values will be between 0-255 or 0-1 (based on the scale). The values over that are capped. So, bigger the value is, better it is, till the max cap. After that, the value has no effect. The same applies to min value as well

---

<div class="post-metadata">

**Author:** ![durgaamma2005](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/durgaamma2005/32/117_2.png) [@durgaamma2005](https://community.wandb.ai/u/durgaamma2005)\
**Post date:** [August 26, 2021, 3:28am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/9 "2021-08-26T03:28:30Z")

</div>

thanks for the clarification

---

<div class="post-metadata">

**Author:** ![girijesh](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/girijesh/32/39_2.png) [@girijesh](https://community.wandb.ai/u/girijesh)\
**Post date:** [August 26, 2021, 3:32am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/10 "2021-08-26T03:32:21Z")

</div>

It should be a single matrix torch.Size([64, 1, 28, 28]) , wondering how it looks like ?

---

<div class="post-metadata">

**Author:** ![kevinb](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/kevinb/32/36_2.png) [@kevinb](https://community.wandb.ai/u/kevinb)\
**Post date:** [August 26, 2021, 3:34am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/11 "2021-08-26T03:34:04Z")

</div>

I think he will talk about why we lost the 2x2

---

<div class="post-metadata">

**Author:** ![vinayak\_nayak](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@vinayak\_nayak](https://community.wandb.ai/u/vinayak_nayak)\
**Post date:** [August 26, 2021, 3:35am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/12 "2021-08-26T03:35:49Z")

</div>

If we have a RGB image i.e. input is 3 channels, then if we apply these 4 kernels, will we get 12 channels in the output?

i.e. ip → `[64, 3, 28, 28]` & op → `[64, 12, 26, 26]`?

---

<div class="post-metadata">

**Author:** ![girijesh](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/girijesh/32/39_2.png) [@girijesh](https://community.wandb.ai/u/girijesh)\
**Post date:** [August 26, 2021, 3:37am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/13 "2021-08-26T03:37:14Z")

</div>

On this tensor torch.Size([64, 1, 28, 28]) if we apply 4 filter , it will produce 4 torch.Size([64, 1, 26, 26]) for each filter which will be stacked and make a torch.Size([64, 4, 28, 28]) output. and Size is reduce from 28 to 26 because of applying the filter.

---

<div class="post-metadata">

**Author:** ![kevinb](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/kevinb/32/36_2.png) [@kevinb](https://community.wandb.ai/u/kevinb)\
**Post date:** [August 26, 2021, 3:37am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/14 "2021-08-26T03:37:56Z")

</div>

I believe the reason is because our kernels are size 3x3 so when we compute each location, we lose 2 pixels in each direction because it won’t be able to stride past the 28x28 size  
(Showing it on 9 wide)  
[1,2,3,4,5,6,7,8,9]  
[1,2,3] - 1  
[2,3,4] - 2  
[3,4,5] - 3  
[4,5,6] - 4  
[5,6,7] - 5  
[6,7,8] - 6  
[7,8,9] - 7

---

<div class="post-metadata">

**Author:** ![vinayak\_nayak](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@vinayak\_nayak](https://community.wandb.ai/u/vinayak_nayak)\
**Post date:** [August 26, 2021, 3:37am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/15 "2021-08-26T03:37:58Z")

</div>

The edges couldn’t be centered and since our kernel size is `3x3` then, we have to leave a buffer of 1 row per side (top, bottom, left and right). Hence `28 x 28` reduces to `26 x 26`.

---

<div class="post-metadata">

**Author:** ![durgaamma2005](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/durgaamma2005/32/117_2.png) [@durgaamma2005](https://community.wandb.ai/u/durgaamma2005)\
**Post date:** [August 26, 2021, 3:40am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/16 "2021-08-26T03:40:46Z")

</div>

can kernels or filters be more than 4 in no?

---

<div class="post-metadata">

**Author:** ![skr1125](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/skr1125/32/63_2.png) [@skr1125](https://community.wandb.ai/u/skr1125)\
**Post date:** [August 26, 2021, 3:41am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/17 "2021-08-26T03:41:25Z")

</div>

yes. the number of kernels/filters can and do vary in number. we will see this shortly and also learn how and why we change their number.

---

<div class="post-metadata">

**Author:** ![kevinb](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/kevinb/32/36_2.png) [@kevinb](https://community.wandb.ai/u/kevinb)\
**Post date:** [August 26, 2021, 3:44am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/18 "2021-08-26T03:44:27Z")

</div>

I had a misunderstanding for the longest time that the number of filters had something to do with the sizes, but the size is actually determined by kernel size (and a few other arguments) but not the number of filters you use

---

<div class="post-metadata">

**Author:** ![vinayak\_nayak](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@vinayak\_nayak](https://community.wandb.ai/u/vinayak_nayak)\
**Post date:** [August 26, 2021, 3:45am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/19 "2021-08-26T03:45:24Z")

</div>

Do we convert the RGB image to black & white before doing convolution?

Because I didn’t understand otherwise how `3 channels -> 64 channels`. If we do for every input channel, it should be `3 channels -> 3 * 64 = 192 channels`.

---

<div class="post-metadata">

**Author:** ![girijesh](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/girijesh/32/39_2.png) [@girijesh](https://community.wandb.ai/u/girijesh)\
**Post date:** [August 26, 2021, 3:45am UTC](https://community.wandb.ai/t/week-12-discussion-thread/260/20 "2021-08-26T03:45:45Z")

</div>

yes, you can choose any number of kernel.

[Next page](https://community.wandb.ai/t/week-12-discussion-thread/260.md?page=2)
