Machine Learning Basics
How many trainable parameters does a fully connected layer with 64 inputs and 32 outputs (one bias per output) have?
- A96
- B2048
- 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.