How to find mean and standard deaviation for normalization

how do you calculate the mean and standard deviation for image normalization??

.mean() and .std() methods of a tensor should help.

like where do i type these sorry i forgot everything cuz been on a break

Hey!! you can use this code to find out the mean and standard deviation of the individual channel from the image.

mean = 0
std = 0
for i in range(len(dataset)):
image, _ = dataset[i]
mean+=image[0].mean()
std+=image[0].std()

print(mean/len(dataset))
print(std/len(dataset))

From this you get the output as mean=0.4914 and standard deviation=0.2023.