Skip to content
DeepForgeby svx
All problems
MediumDeep Learningdl-256

RegNet Width Formula

Problem

Generate RegNet stage widths: the unquantized width at stage i is w0 + wa * i, quantized to the nearest multiple of wm using floor(u / wm + 0.5) * wm.

The signature is regnet_width(w0, wa, wm, depth). Return the list of widths.

Hint

Quantizing widths to a fixed multiple made RegNet designs easy to search and reproduce.

Test cases

case 1
in: [24,16,8,4]
expected: [24,40,56,72]
case 2
in: [32,8,4,3]
expected: [32,40,48]
case 3
in: [16,24,8,3]
expected: [16,40,64]
case 4
in: [10,10,4,3]
expected: [12,20,32]
Starter codePython
def regnet_width(w0, wa, wm, depth):
    # Your code here
    pass

4 test cases · run your code against them in the editor