Created
          January 22, 2020 01:59 
        
      - 
      
- 
        Save vsay01/80e1d915c838ec865e910826424ac8c4 to your computer and use it in GitHub Desktop. 
    FashionClassifier model
  
        
  
    
      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 your network ( Simple Example ) | |
| class FashionClassifier(nn.Module): | |
| def __init__(self): | |
| super().__init__() | |
| input_size = 784 | |
| self.fc1 = nn.Linear(input_size, 512) | |
| self.fc2 = nn.Linear(512, 256) | |
| self.fc3 = nn.Linear(256, 128) | |
| self.fc4 = nn.Linear(128, 64) | |
| self.fc5 = nn.Linear(64,10) | |
| self.dropout = nn.Dropout(p=0.2) | |
| def forward(self, x): | |
| x = x.view(x.shape[0], -1) | |
| x = self.dropout(F.relu(self.fc1(x))) | |
| x = self.dropout(F.relu(self.fc2(x))) | |
| x = self.dropout(F.relu(self.fc3(x))) | |
| x = self.dropout(F.relu(self.fc4(x))) | |
| x = F.log_softmax(self.fc5(x), dim=1) | |
| return x | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment