How to accelerate matrix operations(multiplication, add, inverse) in a for loop?

Hi all, I cleaned up the code a little bit, it turns out the bottleneck is at this line:

corr = (noisyPatch[px,py] ⋅ b) / noisyPatchNorm[px,py]

any idea on how to optimize this?

1 Like