MCPcopy Index your code
hub / github.com/pytorch/tutorials / Mnist_CNN

Class Mnist_CNN

beginner_source/nn_tutorial.py:700–713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

698# ``reshape``)
699
700class Mnist_CNN(nn.Module):
701 def __init__(self):
702 super().__init__()
703 self.conv1 = nn.Conv2d(1, 16, kernel_size=3, stride=2, padding=1)
704 self.conv2 = nn.Conv2d(16, 16, kernel_size=3, stride=2, padding=1)
705 self.conv3 = nn.Conv2d(16, 10, kernel_size=3, stride=2, padding=1)
706
707 def forward(self, xb):
708 xb = xb.view(-1, 1, 28, 28)
709 xb = F.relu(self.conv1(xb))
710 xb = F.relu(self.conv2(xb))
711 xb = F.relu(self.conv3(xb))
712 xb = F.avg_pool2d(xb, 4)
713 return xb.view(-1, xb.size(1))
714
715lr = 0.1
716

Callers 1

nn_tutorial.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected