Link between ResNet class parameters and layers
I’ve been trying to wrap my head around how to link ResNet(dls.c, [2,2,2,2])
with ResNet-18 and ResNet(dls.c, [3,4,6,3], 4)
with ResNet-50 in the ResNets chapter of the fastbook.
I’ve had a look at the resulting sequential model, as well as the output of learn.summary()
. But I am not sure what to “count” as an layer and what not. I came up with a formula that would count every ResBlock as two layers. layer_amount = stem_layer + sum(layers_array*2) + fully_connected_layer
.
It works for ResNet(dls.c, [2,2,2,2])
being layer_amount=1+[4,4,4,4]+1
resulting in ResNet-18. But then ResNet(dls.c, [3,4,6,3], 4)
would be ResNet-34 based on my formula, but it should be ResNet-50 according to the book.
Can anybody help me out?