I have based my model upon the following tutorial:
https://github.com/torch/tutorials/tree/master/2_supervised
For the last stage a neural network is used upon the features extracted from the CNN. I want to use a SVM in the final layer. How can I add that to my existing model ?
It has been shown in some papers that SVM seem to function better than neural network as the final layer in the CNN and therefore I wanted to try them out to increase the accuracy of the model. Also SVM's can be use for one class classification which neural networks lack.I need a one class classifier in the end and so the need for adding an SVM to th CNN.
Kindly help
Edit: My old answer was complete rubbish since you cannot code a (linear) SVM as a complete module. Instead, you can think of an SVM as
(see accepted answer's comments.)
This means that in Torch, you can mock up a (linear) SVM with something like
see the following question in the Torch7 google code mailing list...