<jupyter_start><jupyter_text>Transforms Data does not always come in its final processed form, we us etransform to turn the data into a foprm suitable for processing. All Torch vision datasets have 2 parameters. - **Transform: to modify the features** and **target_transform: To transform the labels** The fashion Mnist features are in PIL format and the labels are integers. For training we need the features as normalized tensiors and the labels as one hot encoded tensors.To make these transformations we make use of *ToTensor* and *lamda*<jupyter_code>from torchvision import datasets 
from torchvision.transforms import ToTensor, Lambda

ds = datasets.FashionMNIST(
    root="data",
    train=True,
    download=True,
    transform=ToTensor(),
    target_transform=Lambda(lambda y: torch.zeros(10,dtype=torch.float).scatter_(0, torch.tensor(y), ))
)<jupyter_output><empty_output><jupyter_text>*To Tensor:* converts a PIL image or NumPy ndarray into a FloatTensor and scales the image's pixel intensity values in the range [0., 1.] *Lamda Transform:* Lambda transforms apply any user-defined lambda function. Here, we define a function to turn the integer into a one-hot encoded tensor. It first creates a zero tensor of size 10 (the number of labels in our dataset) and calls scatter which assigns a value=1 on the index as given by the label y.``` This is formatted as code```<jupyter_code><jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup