All problems
Denormalize
Problem
Invert per-channel normalization.
Return v * std[c] + mean[c] for every channel value, rounded to 4 decimal places. No clamping is applied.
Test cases
case 1
in: [[[[-2,0,2]]],[128,128,128],[64,64,64]]
expected: [[[0,128,256]]]
case 2
in: [[[[0,0],[4,2]]],[10,20],[5,10]]
expected: [[[10,20],[30,40]]]
case 3
in: [[[[1,0]]],[0,0],[1,1]]
expected: [[[1,0]]]
Starter codePython
def denormalize(image, mean, std):
# Your code here
pass3 test cases · run your code against them in the editor