<reponame>koldbrandt/mlops_fuzzy-octo-waffle
import torch
import torch.nn as nn


# Architecture
class ConvNet(torch.nn.Module):
    def __init__(self, num_classes):
        super().__init__()
        self.num_classes = num_classes
        self.layers = torch.nn.Sequential(
            # 1st Convolution
            nn.Conv2d(3, 64, kernel_size=3, stride=2, padding=1),
            nn.BatchNorm2d(64),
            nn.LeakyReLU(0.1, inplace=True),
            # 2nd Convolution
            nn.Conv2d(64, 64, kernel_size=3, stride=1, padding=1),
            nn.BatchNorm2d(64),
            nn.LeakyReLU(0.1, inplace=True),
            # 3rd Convolution
            nn.Conv2d(64, 64, kernel_size=3, stride=2, padding=1),
            nn.BatchNorm2d(64),
            nn.LeakyReLU(0.1, inplace=True),
            # MLP Layer
            nn.Flatten(),
            nn.Linear(16384, 128),
            nn.BatchNorm1d(128),
            nn.LeakyReLU(0.1, inplace=True),
            nn.Dropout(0.5),
            #
            nn.Linear(128, num_classes),
        )

    def forward(self, x):
        logits = self.layers(x)
        return logits
