diff --git a/Deep Learning/submission_template04.py b/Deep Learning/submission_template04.py index 498fa3e..4a2113c 100644 --- a/Deep Learning/submission_template04.py +++ b/Deep Learning/submission_template04.py @@ -5,11 +5,18 @@ class ConvNet(nn.Module): def __init__(self): - ... + super(ConvNet, self).__init__() + self.conv1 = nn.Conv2d(1, 16, kernel_size=3, stride=1, padding=1) + self.pool = nn.MaxPool2d(kernel_size=2, stride=2) + self.conv2 = nn.Conv2d(16, 32, kernel_size=3, stride=1, padding=1) + self.fc1 = nn.Linear(32 * 7 * 7, 10) - def forward(self, x): - ... + x = self.pool(F.relu(self.conv1(x))) + x = self.pool(F.relu(self.conv2(x))) + x = x.view(-1, 32 * 7 * 7) + x = self.fc1(x) + return x def create_model(): return ConvNet()