Class-balanced-loss-pytorch icon indicating copy to clipboard operation
Class-balanced-loss-pytorch copied to clipboard

Pytorch implementation of the paper "Class-Balanced Loss Based on Effective Number of Samples"

Results 17 Class-balanced-loss-pytorch issues
Sort by recently updated
recently updated
newest added

Hi @vandit15, Thanks for sharing your code. In line 73, `weights = weights / np.sum(weights) * no_of_classes`, why is no_of_classes included here to normalise the weights? Any help would be...

https://github.com/vandit15/Class-balanced-loss-pytorch/blob/921ccb8725b1eb0903b2c22a1a752a594fcae138/class_balanced_loss.py#L28 should be `alpha: A float tensor of size [num_classes]`

does someone has implement focal_loss with softmax correctly?could you recommend its link for me?thank you very much

Thanks for sharing your code. I have 4D tensor.. I just understand your code. Thanks!

why add this sum make all class weight the same ![image](https://user-images.githubusercontent.com/6283983/105962017-38ea6100-60ba-11eb-9b60-9dc4c07a1fe8.png)

Hi, thanks for your code sharing! I am now trying to understand how do you implement and I have something want to discuss. In your main function you have provide...

the keyword had a typo: 'weight' instead of 'weights'. in case weights requires grads, it needs to be detached first as BCEwithlogits is not implemented for grad tracked tensor

@vandit15 thanks for open-sourcing the code , is it possible to use Cb loss in the object detection or segmentation architecture ?? did you experiment it with any std architecture...

Instead calculating a weight for each batch, applying to class using pos_weight argument in `torch.nn.BCELoss(pos_weights=weights)` Simply, https://github.com/vandit15/Class-balanced-loss-pytorch/blob/master/class_balanced_loss.py#L71-L82 Are those line of codes same with ``` effective_num = 1.0 - np.power(beta,...