I am trying to do a multi-class classification in pytorch. The code runs fine, but the accuracy is not good. I was wondering if my code is correct?
The input to the model is a matrix of 2000x100 and the output is a 1D tensor with the index of the label ex: tensor([2,5,31,…,7]) => 2000 elements
# another multi-class classification
class MultiClass(nn.Module):
    
    def __init__(self, x_dim, z_dim):
        super(MultiClass, self).__init__()

        self.cf1  = nn.Linear(z_dim, z_dim)
        self.cf1N = nn.BatchNorm1d(num_features = z_dim)
        self.cf1D = nn.Dropout(0.5) 
        
        self.cf2  = nn.Linear(z_dim, z_dim)
        self.cf2N = nn.BatchNorm1d(num_features = z_dim)
        self.cf2D = nn.Dropout(0.5)
        self.cf3  = nn.Linear(z_dim, 32)

        
    def classifier(self,z):
        return F.softmax((self.cf3(self.cf2D(F.relu(self.cf2N(self.cf2(self.cf1D(F.relu(self.cf1N(self.cf1(z)))))))))))
            

    def forward(self, z):
        return self.classifier(z)
    

def MultiClass_loss_function(out, label):

    secLoss = F.cross_entropy(out, label.long())

    return secLoss