rewrite Hog and svm