Hi, I am trying to run a simple VAE model written in pytorch. To that end, I use the classical MNIST dataset by means of torchvision.datasets. Now, the data have been already downloaded and recorded in its raw values i.e., [0, 255]). Once I load it from the directory, the transforms defined to normalize the data into [-1, 1] with zero mean and unit variance, is not applied. Ergo, the data is in its original range [0, 255]. How could I do the scaling into [0,1] and the to reapply the transforms.Normalize? Here is the code:
transform_train = transforms.Compose([
    transforms.ToTensor(),
    transforms.Normalize(mean=(0.1307,), std=(0.3081,))
])

transform_test = transforms.Compose([
    transforms.ToTensor(),
    transforms.Normalize(mean=(0.1307,), std=(0.3081,))
])

use_cuda = torch.cuda.is_available()

trainset = datasets.MNIST(root='../../data/MNIST', train=True, download=False, transform=transform_train)
valset = datasets.MNIST(root='../../data/MNIST', train=False, download=False, transform=transform_test)