diff --git a/Deep Learning/submission_template04.py b/Deep Learning/submission_template04.py index 498fa3e..f9c59b7 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=3, kernel_size=5) + self.pool1 = nn.MaxPool2d(kernel_size=2) + self.conv2 = nn.Conv2d(in_channels=3, out_channels=5, kernel_size=3) + self.pool2 = nn.MaxPool2d(kernel_size=2) + self.flatten = nn.Flatten() + self.fc1 = nn.Linear(5 * 6 * 6, 100) + self.fc2 = nn.Linear(100, 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()