Machine Learning Basics

How many trainable parameters does a fully connected layer with 64 inputs and 32 outputs (one bias per output) have?

  1. A96
  2. B2048
  3. C2080
Show answer and explanation

Answer: C. 2080

A fully connected layer has one weight for every pair of an input and an output, so there are 64 × 32 = 2048 weights. Adding the 32 biases, one per output, gives 2048 + 32 = 2080 parameters. In general, a fully connected layer with n inputs and m outputs has (n + 1) × m parameters. A convolutional layer reuses the same filter over the whole image, so it has far fewer parameters than a fully connected layer for an input of the same size.

  • A. This is the sum of the numbers of inputs and outputs. There is a weight for every input–output pair, so the numbers are multiplied.
  • B. This forgets to count the 32 biases.
  • C. Correct. 64 × 32 + 32 = 2080.
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. 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?
  2. Which of the following correctly describes recurrent neural networks (RNNs) and LSTMs?
  3. Which of the following describes the self-attention used in the Transformer?
  4. 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?
  5. Which of the following correctly describes models that generate images and similar data?