Thanks for your answer. Actually, my code is computing the exact class_weight each time: class_weight = torch.tensor([1,batch.num_nodes/(batch_size*2)]).double(), where batch.num_nodes/(batch_size*2) is roughly 4. But I still have the same problem.
It could be that my model is just bad, that’s fine. But the fact that no matter how much I change the weights (for example class_weights = torch.tensor([1, 99999]) it always predicts every node as 0.That makes me think the weights are not passed properly. Shouldn’t the prediction change to predict every node as a 1 with that extreme class_weight?