diff --git a/Deep Learning/submission_template04.py b/Deep Learning/submission_template04.py index 498fa3e..38ba55d 100644 --- a/Deep Learning/submission_template04.py +++ b/Deep Learning/submission_template04.py @@ -5,11 +5,33 @@ class ConvNet(nn.Module): def __init__(self): - ... + super().__init__() + + self.conv1 = nn.Conv2d(in_channels=3, out_channels=3, kernel_size=(5, 5)) + self.pool1 = nn.MaxPool2d(kernel_size=(2, 2)) + self.conv2 = nn.Conv2d(in_channels=3, out_channels=5, kernel_size=(3, 3)) + self.pool2 = nn.MaxPool2d(kernel_size=(2, 2)) + + self.flatten = nn.Flatten() + + self.fc1 = nn.Linear(in_features=5 * 6 * 6, out_features=100) + self.fc2 = nn.Linear(in_features=100, out_features=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()