MCPcopy Create free account
hub / github.com/pytorch/tutorials / Net

Class Net

beginner_source/introyt/introyt1_tutorial.py:481–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479#
480
481class Net(nn.Module):
482 def __init__(self):
483 super(Net, self).__init__()
484 self.conv1 = nn.Conv2d(3, 6, 5)
485 self.pool = nn.MaxPool2d(2, 2)
486 self.conv2 = nn.Conv2d(6, 16, 5)
487 self.fc1 = nn.Linear(16 * 5 * 5, 120)
488 self.fc2 = nn.Linear(120, 84)
489 self.fc3 = nn.Linear(84, 10)
490
491 def forward(self, x):
492 x = self.pool(F.relu(self.conv1(x)))
493 x = self.pool(F.relu(self.conv2(x)))
494 x = x.view(-1, 16 * 5 * 5)
495 x = F.relu(self.fc1(x))
496 x = F.relu(self.fc2(x))
497 x = self.fc3(x)
498 return x
499
500
501net = Net()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected