please calculate ones(xscale, yscale) / (xscale*yscale) in cnnsetup, put it in the net somewhere (net._meanFilter or similar), use that and remove the comment to replace with var