Skip to content
DeepForgeby svx
All problems
EasyComputer Visioncv-224

Conv Bias Add

Problem

Add a per-channel bias to a feature map.

Broadcast bias[c] over every pixel of channel c and round to 4 decimal places.

Test cases

case 1
in: [[[[1,2],[3,4]]],[10,-1]]
expected: [[[11,1],[13,3]]]
case 2
in: [[[[0,0,0]]],[1,2,3]]
expected: [[[1,2,3]]]
case 3
in: [[[[1,1],[2,2]]],[0,5]]
expected: [[[1,6],[2,7]]]
Starter codePython
def add_bias(feature, bias):
    # Your code here
    pass

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