All problems
ReLU Feature Map
Problem
Apply ReLU to every element of a 2D feature map.
Return a new nested list where each value is max(0.0, v).
Hint
Nonlinearity is applied independently to each activation.
Test cases
case 1
in: [[[-1,0],[2,-3]]]
expected: [[0,0],[2,0]]
case 2
in: [[[]]]
expected: [[]]
case 3
in: [[[0]]]
expected: [[0]]
case 4
in: [[[1.5,-2.5]]]
expected: [[1.5,0]]
Starter codePython
def relu_map(feature_map):
# Your code here
pass4 test cases · run your code against them in the editor