Hi, I am trying multiclass classification on music genre dataset using pytorch. It has 1000 examples, where each vector has 28 features. And trying to predict amongst 10 different classes. For each example, I created label vector of 10 elements and set the desired element in the vector to 1. I am using MultiLabelSoftMarginLoss().
I was trying to calculate F1 score, but I found out that after training, for each training example, same output neuron has maximum activation amongst others, which makes this model to classify every training example as same class. But, the loss when printed, reaches to 0.30.
This is the link to the code: https://github.com/linonymous/MusicGenreClassifier/blob/master/Classifier%20Models/Neural%20Network/three_layer_nn_pytorch.py
Could you please explain, what’s going in here?
Thanks in advance!