Take a look at Regularized Loss Function included in https://github.com/meng-tang/rloss
Take a look at Regularized Loss Function included in https://github.com/meng-tang/rloss