How many trainable parameters does this layer have?
import torch.nn as nn layer = nn.Linear(784, 128)
- 100,480
- 100,352
- 100,608
- 100,000
784 x 128 weights = 100,352 plus 128 biases = 100,480.
Play AI & ML ▸
import torch.nn as nn layer = nn.Linear(784, 128)