hello, can anyone help me to implement binary cross entropy loss with label smoothing?

If you’re okay with `CrossEntropyLoss`

instead of `BCELoss`

, `CrossEntropyLoss`

comes with an optional `label_smoothing`

parameter. Otherwise, you can try using this:

```
eps = 0.1
y_true = y_true * (1 - eps) + (eps / 2)
```

_{Binary cross entropy label smoothing formula taken from here.}

1 Like

I found in YOLOv9 uses BCE label smoothing but I dont know how to implement it to my code :v can you help me to provide a sample