SHARE
TWEET

Untitled

a guest Feb 27th, 2020 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class model(nn.Module):
  2.     def __init__(self, num_classes=10):
  3.         # ------------ConvNet Model
  4.         # Definition-------------------------------------------
  5.         super(model, self).__init__()
  6.  
  7.         self.layer1 = nn.Sequential(
  8.             nn.Conv2d(in_channels=1, out_channels=16, kernel_size=3, stride=1,
  9.                       padding=0),
  10.             nn.ReLU(),
  11.             nn.BatchNorm2d(num_features=16),
  12.             nn.MaxPool2d(kernel_size=2, stride=1),
  13.             Downsample(channels=16, filt_size=5, stride=2))  
  14.  
  15.         self.layer2 = nn.Sequential(
  16.             nn.Conv2d(in_channels=16, out_channels=32, kernel_size=4, stride=1,
  17.                       padding=0),
  18.             nn.ReLU(),
  19.             nn.BatchNorm2d(num_features=32),
  20.             nn.MaxPool2d(kernel_size=2, stride=1),
  21.             Downsample(channels=32, filt_size=5, stride=2))
  22.  
  23.         self.fc1 = nn.Linear(2048, 100)
  24.         self.fc2 = nn.Linear(100, num_classes)
  25.         self.softmax = nn.Softmax(1)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top