Heavy regression loss for false non 0 prediction My regression should predict values  >=0
But a wrongly predicted value >0(e.g. 0.001 instead of 0) is much worse then a a slight missprediction of 0.001 (e.g. 0.002 instead of 0.003)

I am thinking about a costume loss function that weights the false non zeros to return a big loss.

Is there a more elegant way ?

Edit: 

this is my unelegant sollution:

def custom_loss(y,yh):
    if y == 0:
        loss = tf.math.minimum(100,yt*100000)
    else :
        loss = losses.mean_squared_error(yh,y)

    return loss
One option would be Huber Loss which could be setup to increase the weight for some types of errors compared to other errors.