I have a question regarding nn.Linnar.
In the documentation it says:
Parameters:
in_features – size of each input sample
out_features – size of each output sample
As an example we have the following model:
model_cnn = nn.Sequential(nn.Conv2d(1, 32, 3, padding=1), nn.ReLU(),
                          nn.Conv2d(32, 32, 3, padding=1, stride=2), nn.ReLU(),
                          nn.Conv2d(32, 64, 3, padding=1), nn.ReLU(),
                          nn.Conv2d(64, 64, 3, padding=1, stride=2), nn.ReLU(),
                          Flatten(),
                          nn.Linear(7*7*64, 100), nn.ReLU(),
                          nn.Linear(100, 10)).to(device)


Where do the values (7*7*64, 100) in the first nn.Linear and (100, 10) in the second nn.Linear come from?
I can’t figure out how these values are calculated.