Skip to content
DeepForgeby svx
All problems
MediumDeep Learningdl-215

Outlier Channel Detect

Problem

Find activation channels with extreme values. activations has shape (num_examples, channels); return the ascending list of channels whose maximum absolute activation exceeds threshold.

The signature is outlier_channels(activations, threshold).

Hint

Outlier channels are why per-channel and per-group quantization often beat per-tensor.

Test cases

case 1
in: [[[1,10,2],[1,1,1]],5]
expected: [1]
case 2
in: [[[1,2],[3,4]],10]
expected: []
case 3
in: [[[-20,0,5]],15]
expected: [0]
case 4
in: [[[0,0],[0,0]],0]
expected: []
Starter codePython
def outlier_channels(activations, threshold):
    # Your code here
    pass

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