title: What are transforms in PyTorch used for?
body: <p>I am new with Pytorch and not very expert in CNN.
  I have done a successful classifier with the tutorial that they provide <a href="http://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html" rel="noreferrer">Tutorial Pytorch</a>, but I don't really understand what I am doing when loading the data.</p>
  
  <p>They do some data augmentation and normalisation for training, but when I try to modify the parameters, the code does not work.</p>
  
  <pre><code># Data augmentation and normalization for training
  # Just normalization for validation
  data_transforms = {
      'train': transforms.Compose([
          transforms.RandomResizedCrop(224),
          transforms.RandomHorizontalFlip(),
          transforms.ToTensor(),
          transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
      ]),
      'val': transforms.Compose([
          transforms.Resize(256),
          transforms.CenterCrop(224),
          transforms.ToTensor(),
          transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
      ]),
  }
  </code></pre>
  
  <p>Am I extending my training dataset? I don't see the data augmentation.</p>
  
  <p>Why if I modify the value of transforms.RandomResizedCrop(224) the data loading stop working? </p>
  
  <p>Do I need to transform as well the test dataset?</p>
  
  <p>I am a bit confused with this data transformation that they do.</p>