Thank you so much for the reply. Here is a followup though. I see there is also an implementation for the function MultiLabelSoftMarginLoss. I think in spirit it is similar to the BCEWithLogitLoss and since I have a multi label classification, I thought it would be better to use the MultiLabelSoftMarginLoss function. However, there is no pos_weight parameter in it. Is there a way I can use it or should I stick to BCEWithLogitLoss.
Also, just to be sure, should I use pos_weight = neg_samples_of_each_class/ pos_samples_of_each_class in the loss formulation?