All problems
MBConv Parameter Count
Problem
Count the weights of an MBConv block without biases: expansion 1x1 (in_channels * hidden), depthwise kernel (hidden * k * k) and projection 1x1 (hidden * out_channels), where hidden = in_channels * expand_ratio.
The signature is mbconv_param_count(in_channels, out_channels, kernel_size, expand_ratio). Return an integer.
Hint
Depthwise convolution uses one kernel per channel, so its weight count is small.
Test cases
case 1
in: [24,24,3,6]
expected: 8208
case 2
in: [16,24,3,6]
expected: 4704
case 3
in: [1,1,3,1]
expected: 11
case 4
in: [32,16,5,4]
expected: 9344
Starter codePython
def mbconv_param_count(in_channels, out_channels, kernel_size, expand_ratio):
# Your code here
pass4 test cases · run your code against them in the editor