This is my model and loss function for 2 labels: style and layout, each have more than 10 classes. Is it true? How can i improve it?
﻿﻿class MyModel(nn.Module):
    def __init__(self, n__classes=32):
        super().__init__()
        self.base_model = models.resnet50(pretrained=True).to(device)
        last_channel = self.base_model.fc.in_features
        self.base_model.fc = nn.Sequential()
        
        self.layout = nn.Sequential(
            nn.Dropout(0.2),
            nn.Linear(last_channel, n_classes_layout),
            nn.Sigmoid()
        )
        self.style = nn.Sequential(
            nn.Dropout(0.2),
            nn.Linear(last_channel, n_classes_style),
            nn.Sigmoid()
        )
    def forward(self, x):
        base = self.base_model(x)
        return self.layout(base), self.style(base)

def loss_fn(outputs, targets):
    o1, o2 = outputs
    t1, t2 = targets
    l1 = nn.BCELoss()(o1, t1)
    l2 = nn.BCELoss()(o2, t2)
    return (l1 + l2) / 2