Skip to content
DeepForgeby svx
All problems
EasyComputer Visioncv-221

Global Max Pool

Problem

Compute global max pooling over an H x W x C feature map.

Return the maximum activation of each channel as a list of C values.

Hint

Reduce each channel independently with a maximum.

Test cases

case 1
in: [[[[1,2],[3,4]],[[5,6],[7,8]]]]
expected: [7,8]
case 2
in: [[[[10,0,5]]]]
expected: [10,0,5]
case 3
in: [[[[2,4],[6,8]],[[1,1],[1,1]]]]
expected: [6,8]
Starter codePython
def global_max_pool(feature):
    # Your code here
    pass

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