I'm trying to solve a regression problem using a neural network. In my problem domain, an underestimation is a lot worse than an overestimation, so I thought I'd create a custom loss function for my network. Currently, I'm thinking about something along the lines of: $$Loss(pred, label) = \begin{cases} x & \text{if } pred - label \geq 0\\ x^2 & \text{if } pred - label < 0 \end{cases}$$
There's one problem I can already see upfront, and that's that the function is not differenciable for $pred-label = 0$
My question here is two-fold:
- What can I do to solve the differenciability problem?
- What other factors are important when choosing/designing loss functions?
(My network will be implemented in TensorFlow, in case this is relevant)