I have a costume loss function:
def loss(p, y):
    fa= -np.dot(1-y), list(np.log(1-,p))
    l = (y * list(np.log(p))
    prod = (1-y) -  l 
    loss = fa+ np.min(prod)
    return loss

p - prediction
y - target
i have a multi label problem, and i want to minimize the even when the prediction was right in only one label. (hence the minimun in my loss)
the problem is, that this function is non differentiable
how can i use this function anyway?