Created
          January 22, 2020 01:57 
        
      - 
      
- 
        Save vsay01/fedac78ec08cecd7b3b1bc471f7f0a6d to your computer and use it in GitHub Desktop. 
    Preprocessing, download and create loader from dataset
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Define a transform to normalize the data | |
| transform = transforms.Compose([transforms.ToTensor(), | |
| transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))]) | |
| # Download and load the training data | |
| trainset = datasets.FashionMNIST('F_MNIST_data/', download=True, train=True, transform=transform) | |
| # Download and load the test data | |
| testset = datasets.FashionMNIST('F_MNIST_data/', download=True, train=False, transform=transform) | |
| loaders = { | |
| 'train' : torch.utils.data.DataLoader(trainset,batch_size = 64,shuffle=True), | |
| 'test' : torch.utils.data.DataLoader(testset,batch_size = 64,shuffle=True), | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment