mlx-examples icon indicating copy to clipboard operation
mlx-examples copied to clipboard

mlx.nn.losses.binary_cross_entropy should have class weights support

Open ubayram opened this issue 1 year ago • 2 comments

For training with imbalanced datasets, providing the weights for classes is one of the most common features I use when training neural networks. The mlx implementation of this loss doesn't have this feature implemented yet, so wanted to point that out.

class mlx.nn.losses.binary_cross_entropy(logits: array, targets: array, reduction: str = 'none')

ubayram avatar Dec 22 '23 09:12 ubayram

hey @awni can I work on this? seems good to start on MLX

guptaaryan16 avatar Jan 04 '24 19:01 guptaaryan16

That would be great!

awni avatar Jan 04 '24 19:01 awni

since this issue is fixed with the merged PR, @awni I would request to close this issue.

sujantkumarkv avatar Jun 11 '24 09:06 sujantkumarkv