1. Home
  2. Explore
  3. Computer Science
  4. Neural Networks Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Neural Networks Overview

  • 23Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Deep Neural Networks Overview

Define a deep neural network in terms of the number of layers.

23 questions

  1. 1

    Define a deep neural network in terms of the number of layers.

    Model answer

    A deep neural network has more than two layers, specifically more than one hidden layer.

    Explanation

    The lecture distinguishes between one-layer (logistic/linear regression), two-layer (one hidden layer), and deep (multiple hidden layers) networks.

  2. 2

    What was the key difference between the ImageNet winners in 2012 compared to previous years, and what was the neural network called?

    Model answer

    In 2012, the winning submission was a deep convolutional neural network called AlexNet, which significantly outperformed previous methods using support vector machines.

    Explanation

    AlexNet had about eight layers and marked a turning point in image classification performance.

  3. 3

    List two reasons given for the recent success of convolutional neural networks in the 2010s, compared to earlier decades.

    Model answer

    Better computation (especially GPUs enabling parallelization) and much more labeled data (e.g., from Amazon Mechanical Turk and the Internet).

    Explanation

    The lecture states that GPUs and large labeled datasets overcame previous limitations.

  4. 4

    How is a grayscale image typically represented as input to a neural network?

    Model answer

    Each pixel takes a value between 0 and P (e.g., 255 for typical grayscale, or 0 and 1 for black and white), and the image is flattened into a vector of pixel values.

    Explanation

    The lecture describes flattening the 2D pixel grid into a 1D vector to feed into the network.

  5. 5

    What two properties of images motivate the use of convolutional layers instead of fully connected layers?

    Model answer

    Spatial locality (features are local, e.g., a stop sign appears in nearby pixels) and translation invariance (the same feature should be detected regardless of its position in the image).

    Explanation

    These properties are exploited by convolution using local filters and weight sharing.

  6. 6

    Describe the convolution operation in a convolutional neural network for a 1D input and a filter of size 3.

    Model answer

    The filter (three weights) is slid across the input, and at each position, a dot product is computed between the filter weights and the three overlapping input values, producing one output value per position.

    Explanation

    This sliding dot product yields a feature map; the filter weights are shared across all positions.

  7. 7

    In the context of CNNs, what does the term 'convolution' typically refer to, and how does it differ from the mathematical definition of convolution?

    Model answer

    In CNNs, 'convolution' actually refers to cross-correlation (sliding dot product without flipping the filter), not the mathematical convolution which involves flipping the filter.

    Explanation

    The lecture explicitly notes this overloading of terms and clarifies that CNN convolution is like correlation.

  8. 8

    For a 2D image (5x5) and a 3x3 filter, what is the size of the output feature map if no padding is used?

    Model answer

    The output size is 3x3, because the filter can only be centered on interior pixels (5-3+1 = 3).

    Explanation

    Without padding, the spatial dimensions shrink by (filter_size - 1) in each dimension.

  9. 9

    What is the purpose of padding in convolutional layers?

    Model answer

    Padding, typically with zeros, is added around the input to allow the filter to be applied to edge pixels, often enabling the output to have the same spatial dimensions as the input.

    Explanation

    The lecture uses padding to detect features at the borders and to maintain size.

  10. 10

    How many parameters (weights and bias) does a single 1D filter of size 3 with a bias have?

    Model answer

    4 parameters: 3 weights and 1 bias.

    Explanation

    The filter has three weights (w1, w2, w3) and an additive bias b.

  11. 11

    Compare the number of parameters in a convolutional layer using a single 1D filter of size 3 (with bias) to a fully connected layer with 10 inputs and 10 outputs (with biases).

    Model answer

    The convolutional layer has 4 parameters, while the fully connected layer has 110 parameters (10 outputs × (10 inputs + 1 bias) = 110).

    Explanation

    Weight sharing in the convolutional layer drastically reduces parameter count.

  12. 12

    What does a ReLU activation function do after a convolution?

    Model answer

    ReLU sets all negative values to 0 and leaves positive values unchanged.

    Explanation

    It introduces non-linearity and is commonly applied after convolution (or fully connected layers).

  13. 13

    In the lecture, what feature did the 1D filter [-1, 1, -1] detect in a sequence of 0s and 1s?

    Model answer

    It detected an isolated 1 (a 1 flanked by 0s on both sides).

    Explanation

    The filter produces a positive output only when a 1 is surrounded by 0s; otherwise output is 0 or negative (clamped to 0 by ReLU).

  14. 14

    What does a max pooling layer do?

    Model answer

    It slides a window (e.g., 3x3) over the input and outputs the maximum value within each window, reducing the spatial size.

    Explanation

    Max pooling summarizes the presence of features in local regions; it has no learnable parameters.

  15. 15

    Define stride in the context of a convolutional or pooling layer.

    Model answer

    Stride is the number of pixels the filter or pooling window moves between successive applications. A stride of 1 means it moves one pixel at a time; a stride of 3 means it moves three pixels.

    Explanation

    Larger strides reduce the output size more aggressively. The lecture uses stride 3 for max pooling to create non-overlapping regions.

  16. 16

    How does max pooling help achieve translation invariance?

    Model answer

    By taking the maximum over a region, the network becomes less sensitive to the exact location of a detected feature within that region.

    Explanation

    If a feature is detected anywhere in the pooling window, the max output activates regardless of precise position.

  17. 17

    Describe the typical architecture of a convolutional neural network for image classification, as outlined in the lecture.

    Model answer

    It consists of multiple stages: input → conv + ReLU → max pool → (repeat several times) → flatten → fully connected layer → softmax for classification.

    Explanation

    The sequence builds increasingly abstract features; the final fully connected layer acts as a classifier.

  18. 18

    Why is the final fully connected layer in a CNN often called the 'output layer' and what role does it play?

    Model answer

    It takes the learned features from previous layers and produces the final prediction (classification or regression), similar to logistic or linear regression.

    Explanation

    The lecture emphasizes that this layer is unchanged from previous network types and performs the actual task.

  19. 19

    What is the 'forward pass' in a CNN?

    Model answer

    The forward pass is the sequence of operations (convolution, activation, pooling, flattening, and final linear combination) that turns an input image into a prediction using current parameters.

    Explanation

    The lecture describes the forward pass as part of the model specification.

  20. 20

    How does training a CNN follow the same pattern as training logistic regression or a fully connected neural network?

    Model answer

    All follow the same three steps: choose a prediction model (forward pass), define a loss function, and minimize the loss over training data using gradient descent (or SGD) to learn parameters.

    Explanation

    The lecture recaps this pattern and notes that the only difference is the model (architecture) used.

  21. 21

    In the backpropagation example for a 1D CNN with one filter of size 3 and no bias, explain why the derivative of the pre-activation Z2Z_2Z2​ with respect to weight W3W_3W3​ equals X3X_3X3​ (with padding considered).

    Model answer

    From the forward pass, Z2=W1X1+W2X2+W3X3Z_2 = W_1 X_1 + W_2 X_2 + W_3 X_3Z2​=W1​X1​+W2​X2​+W3​X3​ (assuming appropriate padding so indices align), so partialZ2/partialW3=X3partial Z_2 / partial W_3 = X_3partialZ2​/partialW3​=X3​.

    Explanation

    The derivative is simply the input value corresponding to that weight at that position.

  22. 22

    What is the dimension of the gradient of the loss with respect to the weights W1W^1W1 in the example with a 1D input of size 5 and a filter of size 3, assuming the loss is a scalar?

    Model answer

    The gradient is a 3x1 vector, since W1W^1W1 has three elements.

    Explanation

    The derivative of a scalar loss with respect to a vector of parameters yields a vector of the same size.

  23. 23

    In the same backpropagation example, how does the derivative partialZ/partialWpartial Z / partial WpartialZ/partialW differ from that in a fully connected layer?

    Model answer

    In a CNN, the derivative matrix has a structure where the same input values appear repeatedly due to weight sharing (a 'wave' of X's), whereas in a fully connected layer each weight has a unique derivative.

    Explanation

    Weight sharing means that each weight contributes to multiple outputs, so the derivative involves multiple input terms.

1 of 23
Question 1 of 23

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent