# Week 13 Discussion Thread

**URL:** <https://community.wandb.ai/t/week-13-discussion-thread/390>\
**Category:** Fastbook Reading Group\
**Created:** [September 1, 2021, 6:46pm UTC](https://community.wandb.ai/t/week-13-discussion-thread/390 "2021-09-01T18:46:41Z")\
**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:** [September 1, 2021, 6:46pm UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/1 "2021-09-01T18:46:41Z")

</div>

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

[![](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/2X/0/0f0f0c55a1425e6ca9186db24b64865749bcb97b.jpeg "W&B Fastbook Reading Group — 13. Our first CNNs from scratch") ](https://www.youtube.com/watch?v=h-q1-oSwWTs)

---

<div class="post-metadata">

**Author:** ![angelicapan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/angelicapan/32/17_2.png) [@angelicapan](https://community.wandb.ai/u/angelicapan)\
**Post date:** [September 1, 2021, 6:59pm UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/2 "2021-09-01T18:59:03Z")

</div>

# Resources

## Blog posts from last week

- @nareshr8’s blog post, [“Convolution Explained”](https://nareshr8.github.io/julia-blogs/2021-08-30-convolutions.html)
- @ravimashru’s blog post, [" Convolutions in Fastai"](https://ravimashru.dev/blog/2021-08-31-convolutions-in-fastai/)
- @VinayakNayak’s [tweet thread on convolutions](https://twitter.com/ElisonSherton/status/1433123252608507905)
- @vrc0503’s blog post on [convolutions](https://blog.r-c.ai/fastbook/fbw12)

## Links from this week

- Aman’s QLD AI HUB talk [“What’s new in computer vision | July Queensland AI”](https://www.youtube.com/watch?v=IYg46wNyDgo) (thanks @allenk for the link!)
- [Batch normalization in 3 levels of understanding](https://towardsdatascience.com/batch-normalization-in-3-levels-of-understanding-14c2da90a338) (thanks for the link, @skr1125!)

---

<div class="post-metadata">

**Author:** ![bgjuee123](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bgjuee123](https://community.wandb.ai/u/bgjuee123)\
**Post date:** [September 2, 2021, 3:14am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/3 "2021-09-02T03:14:55Z")

</div>

Hello Everyone, Good Morning,  
This may be a noob question, but Why we need to Train Resnet50 from Scratch, why not import weights from imagenet , like this but model=ResNet50(weights=“imagenet”)??

---

<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:** [September 2, 2021, 3:25am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/4 "2021-09-02T03:25:48Z")

</div>

is conv2 uses receptive field of both conv1 and the one before that for final calculations.

---

<div class="post-metadata">

**Author:** ![bgjuee123](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bgjuee123](https://community.wandb.ai/u/bgjuee123)\
**Post date:** [September 2, 2021, 3:27am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/6 "2021-09-02T03:27:25Z")

</div>

I mean what’s necessity of Training an architecture/model from Scratch for a particular task, why not initialize the model directly?

@amanarora

---

<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:** [September 2, 2021, 3:28am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/7 "2021-09-02T03:28:48Z")

</div>

@durgaamma2005 Convolution in general has the receptive field. It is the idea to shirk the useful information from the entire image to a smaller tensor. This can be doen by having a stride higher than 1 usually.

---

<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:** [September 2, 2021, 3:29am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/8 "2021-09-02T03:29:13Z")

</div>

Usually you would want to use some sort of pretraining if you can but if you are trying a new architecture it may not have pre-trained weights available

---

<div class="post-metadata">

**Author:** ![allenk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/allenk/32/66_2.png) [@allenk](https://community.wandb.ai/u/allenk)\
**Post date:** [September 2, 2021, 3:30am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/9 "2021-09-02T03:30:13Z")

</div>

Aman’s QLD AI HUB talk [What's new in computer vision | July Queensland AI - YouTube](https://www.youtube.com/watch?v=IYg46wNyDgo)

---

<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:** [September 2, 2021, 3:31am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/10 "2021-09-02T03:31:33Z")

</div>

so will it not be sufficient just to do computations from previous conv layer rather than to do for all previous layers

---

<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:** [September 2, 2021, 3:33am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/11 "2021-09-02T03:33:17Z")

</div>

We could get the input for the previous convolution only if we do the previous convolutions. Its sequential.

---

<div class="post-metadata">

**Author:** ![bgjuee123](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@bgjuee123](https://community.wandb.ai/u/bgjuee123)\
**Post date:** [September 2, 2021, 3:36am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/12 "2021-09-02T03:36:41Z")

</div>

Also Aman , I also request you to host an session About Data Science /Machine Learning Careers & Resume Guidance to help people getting job in DS/ML field.  
Because Its becoming harder to get employed in DS/ML.  
Even an entry level job requires 2-3 Years of Experience  
@amanarora

---

<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:** [September 2, 2021, 3:42am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/13 "2021-09-02T03:42:29Z")

</div>

Think of receptive field as property of pixels of a layer. All the pixels from prior layers which influence the computation of the value of this pixel are in the receptive field of this pixel. So to compute the receptive field of a pixel which is in the output layer of the 2nd convolution - you first figure out all the pixels from the previous layer which would have impacted the calculation of this pixel. Those pixels in the output of the first layer convolve will in turn would have been calculated from a set of pixels in the first layer. So all of these pixels in the first layer will now belong to the receptive field of a pixel in the output of the 2nd layer convolution. That is what the book tries to show. Hope this makes sense.

---

<div class="post-metadata">

**Author:** ![nprithviraj24](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@nprithviraj24](https://community.wandb.ai/u/nprithviraj24)\
**Post date:** [September 2, 2021, 3:45am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/14 "2021-09-02T03:45:55Z")

</div>

How are `nn.Conv2d ()` weights initialised? Are they Gaussian distributed with 0 as mean or random weights between 0 to 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:** [September 2, 2021, 3:46am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/15 "2021-09-02T03:46:50Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/c68f40a58b706d47974697f23d04fe67a1b08cff.png)

Why is the output `[1,12,14,14]`?

```auto
first_cnn = nn.Sequential(*[
    conv(ni, nf) for ni, nf in zip([1,3,7,9], [3,7,9,12])])
x = torch.randn(1, 1, 224, 224)
first_cnn(x).shape

```

---

<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:** [September 2, 2021, 4:09am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/16 "2021-09-02T04:09:38Z")

</div>

Are you going forward to the next model layer or the next minibatch?

---

<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:** [September 2, 2021, 4:10am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/17 "2021-09-02T04:10:31Z")

</div>

So, is it ok to remove those zero values from the architecture for inference so that we get learner model which predicts faster…

---

<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:** [September 2, 2021, 4:15am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/18 "2021-09-02T04:15:19Z")

</div>

I think I just need to play around with it myself. I didn’t know that visual was possible, but it seems very helpful 🙂

---

<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:** [September 2, 2021, 4:18am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/19 "2021-09-02T04:18:57Z")

</div>

Here is another excellent blog/resource on BatchNorm: [https://towardsdatascience.com/batch-normalization-in-3-levels-of-understanding-14c2da90a338](https://towardsdatascience.com/batch-normalization-in-3-levels-of-understanding-14c2da90a338)

---

<div class="post-metadata">

**Author:** ![deep\_learner\_007](https://avatars.discourse-cdn.com/v4/letter/d/e9bcb4/32.png) [@deep\_learner\_007](https://community.wandb.ai/u/deep_learner_007)\
**Post date:** [September 2, 2021, 4:19am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/20 "2021-09-02T04:19:24Z")

</div>

Could you share some resources on how to do data pre-preprocessing

---

<div class="post-metadata">

**Author:** ![deep\_learner\_007](https://avatars.discourse-cdn.com/v4/letter/d/e9bcb4/32.png) [@deep\_learner\_007](https://community.wandb.ai/u/deep_learner_007)\
**Post date:** [September 2, 2021, 4:21am UTC](https://community.wandb.ai/t/week-13-discussion-thread/390/21 "2021-09-02T04:21:04Z")

</div>

centre cropping and selecting frames for video data

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