updated gradient() in l2_regression.cpp

may have fixed nan issue