diff --git a/Deep Learning/submission_template04.py b/Deep Learning/submission_template04.py index 498fa3e..d35068a 100644 --- a/Deep Learning/submission_template04.py +++ b/Deep Learning/submission_template04.py @@ -5,11 +5,27 @@ class ConvNet(nn.Module): def __init__(self): - ... + super().__init__() + self.conv1 = nn.Conv2d(in_channels=3, out_channels=32, kernel_size=5) + self.pool1 = nn.MaxPool2d(kernel_size=2) + self.conv2 = nn.Conv2d(in_channels=32, out_channels=64, kernel_size=3) + self.pool2 = nn.MaxPool2d(kernel_size=2) + self.flatten = nn.Flatten() + self.fc1 = nn.Linear(64 * 6 * 6, 1024) + self.fc2 = nn.Linear(1024, 10) - def forward(self, x): - ... + x = self.conv1(x) + x = F.relu(x) + x = self.pool1(x) + x = self.conv2(x) + x = F.relu(x) + x = self.pool2(x) + x = self.flatten(x) + x = self.fc1(x) + x = F.relu(x) + x = self.fc2(x) + return x def create_model(): return ConvNet()