masoud-khalilian / mldl-waste

0 stars 0 forks source link

add weight to loss function #31

Closed masoud-khalilian closed 10 months ago

masoud-khalilian commented 1 year ago

In order to minimize the effect of class imbalance in our model. The following link has a solution to class imbalance ENet - Real-Time Semantic Segmentation

nn.CrossEntropyLoss(**weight=torch.FloatTensor(class_weights).to(device)**)
nn.CrossEntropyLoss().cuda()