Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #use this one for 4d
  2. class Net(nn.Module):
  3. def __init__(self, count1, count2, fs):
  4. super(Net, self).__init__()
  5. self.conv1 = nn.Conv2d(3, count1, fs)
  6. self.pool = nn.MaxPool2d(2, 2)
  7. self.conv2 = nn.Conv2d(count1, count2, fs)
  8. self.fc1 = nn.Linear(count2 * fs * fs, 120)
  9. self.fc2 = nn.Linear(120, 84)
  10. self.fc3 = nn.Linear(84, 10)
  11.  
  12. def forward(self, x):
  13. x = self.pool(F.relu(self.conv1(x)))
  14. x = self.pool(F.relu(self.conv2(x)))
  15. x = x.view(-1, 16 * 3 * 3)
  16. # x = x.view(-1, 32 * 3 * 3)
  17. # x = x.view(-1, 64 * 3 * 3)
  18. # x = x.view(-1, 128 * 3 * 3)
  19. # x = x.view(-1, 256 * 3 * 3)
  20. # x = x.view(-1, 512 * 3 * 3)
  21. # x = x.view(-1, 1024 * 3 * 3)
  22. x = F.relu(self.fc1(x))
  23. x = F.relu(self.fc2(x))
  24. x = self.fc3(x)
  25. return x
  26.  
  27.  
  28. #net = Net()
  29.  
  30. #net = Net(6, 16, 5)
  31. #net = Net(12, 32, 5)
  32. #net = Net(24, 64, 5)
  33. #net = Net(48, 128, 5)
  34. #net = Net(96, 256, 5)
  35. #net = Net(192, 512, 5)
  36. #net = Net(384, 1024, 5)
  37.  
  38. #use for 4d
  39. net = Net(6, 16, 3)
  40. #net = Net(12, 32, 3)
  41. #net = Net(24, 64, 3)
  42. #net = Net(48, 128, 3)
  43. #net = Net(96, 256, 3)
  44. #net = Net(192, 512, 3)
  45. #net = Net(384, 1024, 3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement