update implementation for lr and linear svm