method1
mu_x = nn.functional.avg_pool2d(x, window_size, 1, padding=1)
sigma_x = nn.functional.avg_pool2d((x  - mu_x)**2, window_size, 1, padding=1)
print(“sigma_x1=”,torch.max(sigma_x))
print(“sigma_x1=”,torch.min(sigma_x))
method2
mu_x = nn.functional.avg_pool2d(x, window_size, 1, padding=1)
sigma_x = nn.functional.avg_pool2d(x2, window_size, 1, padding=1)-mu_x2
print(“sigma_x2=”,torch.max(sigma_x))
print(“sigma_x2=”,torch.min(sigma_x))
I input same gray scaled image. but result seems diferrent
output
(‘sigma_x1=’, tensor(5441.0488, device=‘cuda:0’))
(‘sigma_x1=’, tensor(0., device=‘cuda:0’))
(‘sigma_x2=’, tensor(16055.5547, device=‘cuda:0’))
(‘sigma_x2=’, tensor(-0.0078, device=‘cuda:0’))
Do you have any idea what’s wrong?
and standard deviation cannot be minus. so I guess something wrong with method 2