Additional Flashcards

1
Q

What are the parameters in a convolutional layer?

A

The parameters in a convolutional layer are the weights of the filters (kernels) and the biases. Each filter has weights corresponding to its size and the number of input channels, plus a single bias term.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you calculate the number of parameters in a convolutional layer?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the NHWC format represent in TensorFlow?

A

NHWC format in TensorFlow stands for:

N: Batch size
H: Height of the image
W: Width of the image
C: Number of channels

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the NCHW format represent in PyTorch?

A

NCHW format in PyTorch stands for:

N: Batch size
C: Number of channels
H: Height of the image
W: Width of the image

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you calculate the output dimensions of a convolutional layer?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the shape of an input tensor in TensorFlow with NHWC format for a batch of 16 RGB images of size 64x64?

A

The shape is
[16,64,64,3].

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the shape of an input tensor in PyTorch with NCHW format for a batch of 16 RGB images of size 64x64?

A

The shape is
[16,3,64,64].

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

If a convolutional layer has 10 filters of size 5x5 and the input has 3 channels, how many parameters does the layer have?

A

The number of parameters is:
(5×5×3+1)×10=(75+1)×10=760

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In a convolution operation, what happens when the filter slides over the input image?

A

The filter performs a dot product between its weights and the corresponding region of the input image, summing the contributions from all input channels, and adds a bias term to produce a single value in the output feature map.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Describe the output tensor shape after applying 8 filters of size 3x3 with a stride of 1 and no padding to a batch of 2 RGB images of size 32x32 in TensorFlow (NHWC format).

A

The output tensor shape will be
[2,30,30,8], assuming the height and width are reduced by 2 (32 - 3 + 1).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe the output tensor shape after applying 8 filters of size 3x3 with a stride of 1 and no padding to a batch of 2 RGB images of size 32x32 in PyTorch (NCHW format).

A

The output tensor shape will be
[2,8,30,30], assuming the height and width are reduced by 2 (32 - 3 + 1).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the purpose of padding in convolutional layers?

A

Padding is used to control the spatial dimensions of the output feature map. It adds extra borders to the input image, allowing the filter to fully cover the image borders, and helps maintain the input size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain the difference between valid and same padding in convolutional layers.

A

Valid padding means no padding is added, and the filter only slides within the boundaries of the input image, reducing the spatial dimensions. Same padding adds zero-padding such that the output dimensions are the same as the input dimensions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the role of stride in convolutional layers?

A

Stride controls the step size with which the filter moves over the input image. A stride of 1 means the filter moves one pixel at a time, while a stride greater than 1 means the filter skips pixels, reducing the output dimensions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Calculate the output dimensions for an input of size 64x64 with 3 channels, using a filter of size 5x5, stride 1, and valid padding.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

n TensorFlow, if you have an input tensor of shape
[32,128,128,3] and you apply a convolutional layer with 16 filters of size 3x3, stride 1, and same padding, what will be the shape of the output tensor?

A

The shape of the output tensor will be
[32,128,128,16].

17
Q

In PyTorch, if you have an input tensor of shape
[32,3,128,128] and you apply a convolutional layer with 16 filters of size 3x3, stride 1, and same padding, what will be the shape of the output tensor?

A

The shape of the output tensor will be
[32,16,128,128].

18
Q

What is the formula to calculate the receptive field of a neuron in a convolutional layer?

A
19
Q

How do batch size and number of filters affect the computational complexity of a convolutional layer?

A

Increasing the batch size increases the number of images processed simultaneously, affecting memory usage but often improving computational efficiency. Increasing the number of filters increases the number of operations, as each filter produces an additional output channel, directly affecting the computational complexity.

20
Q

If a convolutional layer has an input tensor of shape
[64,3,224,224] in PyTorch and 32 filters of size
7×7 with stride 2 and padding 3, what is the shape of the output tensor?

A