Machine Learning Basics

A 28×28 single-channel image is convolved with a 5×5 filter (stride 1, no padding), followed by 2×2 max pooling (stride 2). What are the height and width of the output?

  1. A12×12
  2. B14×14
  3. C24×24
Show answer and explanation

Answer: A. 12×12

The output size of a convolution is (N + 2P − F) ÷ S + 1, where N is the input size, F the filter size, P the padding and S the stride. (28 + 0 − 5) ÷ 1 + 1 = 24, so the output after convolution is 24×24. 2×2 max pooling with stride 2 keeps one maximum for each 2×2 region, halving the height and width to 12×12. Pooling has no trainable parameters; it shrinks the data to reduce computation and makes the network less sensitive to small shifts in position.

  • A. Correct. Convolution gives 24×24 and pooling gives 12×12.
  • B. This skips the convolution and applies pooling directly to the 28×28 image.
  • C. This is the size after convolution, without pooling.
Practice this topic Back to topic

Related calculators

Books on Machine Learning Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Machine Learning Basics questions

  1. Which of the following correctly describes recurrent neural networks (RNNs) and LSTMs?
  2. Which of the following describes the self-attention used in the Transformer?
  3. Which of the following describes transfer learning, in which a model trained on a large amount of data is used for a different task with little data?
  4. Which of the following correctly describes models that generate images and similar data?
  5. Which of the following describes how a large language model (LLM) processes text?