<jupyter_start><jupyter_text>Normalization<jupyter_code>import torch 
from torchvision import transforms as T,datasets
import matplotlib.pyplot as plt
import numpy as np
train_ds = datasets.CIFAR10('cifar10/',train = True,
                            download = False,
                            transform = T.ToTensor()) #Load Dataset with only ToTensor Transform
# Collect or append all the images in one empty list

train_imgs = torch.stack([train_imgs_t for train_imgs_t,_ in train_ds],dim = 3) 
train_imgs.shape
# 3,32,32,50000 -> 3,32*32*50000 -> mean

train_imgs.view(3,-1).mean(dim = 1)     
# 3,32,32,50000 -> 3,32*32*50000 ->std

train_imgs.view(3,-1).std(dim = 1)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11347517730496454, 'fraction_numerical': 0.07234042553191489, 'mean_word_length': 3.6143790849673203, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '345636', 'license': 'MIT', 'n_tokens_mistral': 281, 'n_tokens_neox': 248, 'n_words': 57, 'path': 'Pytorch Basic Exercises/Building a CNN with Pytorch/Additional.ipynb', 'repo_name': 'padam56/Miscellaneous', 'size': '705'}