TV-Norm loss not decreasing

I have defined the TV-norm loss for a curve as give in the question: https://dsp.stackexchange.com/questions/45655/tv-norm-what-would-be-the-formula/45659?noredirect=1#comment87695_45659

But the loss is not decreasing. Is there any problem related to differentiability?