I am trying to predict labels for building performance: {1, 0}. Since this is a binary classification, I tried sigmoid and identity activation functions with Xavier initialization. However, I cannot improve the accuracy of my models as the loss and accuracy stay still after training each epoch. This is a very imbalanced dataset where the ones have the 90% majority. So, I assume this might be due to the initial bias. Can you help me with this one? You can see the setup of the training process and the other relevant images attached. model definition , hyperparameters , results
Here are several suggestions which may help:
torch.nn.BCELoss
or torch.nn.BCEWithLogitsLoss
if you don't use sigmoid on last layer. Last linear layer must have output_size=1 in this case.accuracy > best_accuracy
is done on each epoch which is inconsistent.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.