Skip to content
DeepForgeby svx
All problems
EasyDeep Learningdl-240

ControlNet Zero-Conv Params

Problem

ControlNet adds trainable zero convolutions whose weights and biases start at zero. Count their parameters: out_channels * in_channels + out_channels.

The signature is zero_conv_init_params(in_channels, out_channels). Return an integer.

Hint

Zero initialization makes the control branch an identity at the start of training.

Test cases

case 1
in: [320,320]
expected: 102720
case 2
in: [1,1]
expected: 2
case 3
in: [64,128]
expected: 8320
case 4
in: [256,256]
expected: 65792
Starter codePython
def zero_conv_init_params(in_channels, out_channels):
    # Your code here
    pass

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