Create a weighted loss function to handle imbalance?

There don’t seem to be many examples…