Taking different loss based on conditions in a batch

Hi, I recently replied to a few similar topics. You can check them out, you should get some insight about how to solve your problem :slight_smile:

If not, I can write something more personalised