-
Notifications
You must be signed in to change notification settings - Fork 128
Some questions about the code of the svm prediction part #27
Comments
@anbo1024 it can be used in a one-versus-all manner, i.e. in a one-hot encoded vector, instead of using 0 for the classes that a sample does not belong, we use -1 : |
@AFAgarap I still have some doubts. output = tf.identity(tf.sign(output), name='prediction') I think tf. sign and tf. nn. softmax functions can be removed.The following Correct_prediction function already contains the maximum operation. |
Well, in terms of having a one-hot encoded vector with a -1 in place of 0, e.g. |
@AFAgarap I understand what you mean. Now, I use SVM as a loss function on my own dataset, but the performance is very poor, and Softmax performs very well. Why is this? Is the data still to be preprocessed? |
In Yichuan Tang's paper, Deep Learning using Linear Support Vector Machines, he used PCA and added Gaussian noise for MNIST. But that was on a feed-forward neural network with 2 layers having 512 units each. |
The paper is here |
Yes, I have read this article. Good results have been achieved in your code. Did you preprocess it? |
No, I didn't |
This is the predicted output part of the svm network:
output = tf.identity(tf.sign(output), name='prediction')
correct_prediction = tf.equal(tf.argmax(output, 1), tf.argmax(y_input, 1))
After the output is processed by the function tf.sign(),a two-category tag that is processed into (1,-1).This is not predictable for multi-class handwritten data sets.
I want to ask you this question.
The text was updated successfully, but these errors were encountered: