Imported from https://github.com/AFAgarap/cnn-svm