So when I want to do normalization to float64 in deep learning, I need to make float64_max to be 1 or just every image’s max value as 1?
I read a .nii file to get a 3D array with type float64 and its value is very big. I need to normalize it into 0-1 and float32 type to input my deep learning model. So I was wondering which normalization way is better or correct.
Make float64_max to be 1:
return torch.tensor(img / sys.float_info.max).to(torch.float32)
Make every image's max value as 1:
return torch.nn.functional.normalize(torch.tensor(img)).to(torch.float32)
Also, because the float64 range is much bigger than float32, when I do return torch.tensor(img / sys.float_info.max).to(torch.float32)
, the value have a chance to be all 0.