Fix train_grid bug and label output class image.

Also fix svm docs.