Skip to content
This repository has been archived by the owner on May 6, 2023. It is now read-only.

max nargin decision problem in code #25

Closed
mcu1988 opened this issue May 6, 2018 · 3 comments
Closed

max nargin decision problem in code #25

mcu1988 opened this issue May 6, 2018 · 3 comments

Comments

@mcu1988
Copy link

mcu1988 commented May 6, 2018

In cnn-svm/model/cnn_svm.py , output of one versus rest svm is written as :
output = tf.identity(tf.sign(output), name='prediction')
correct_prediction = tf.equal(tf.argmax(output, 1), tf.argmax(y_input, 1))

tf.sign(output) seems incorrect. It should be removed. SVM here use max margin decision. When output margins of multiple binary linear SVM is converted to 1 and -1, tf.argmax(output, 1) may return a false value, because more than one binary linear SVM's output may be converted to 1 as they may all output a positive margin.

@mcu1988 mcu1988 closed this as completed May 6, 2018
@mcu1988 mcu1988 reopened this May 6, 2018
@AFAgarap
Copy link
Owner

AFAgarap commented May 6, 2018

@mcu1988 Will you please describe the problem you see in the implementation? Thank you. :)

@mcu1988
Copy link
Author

mcu1988 commented May 7, 2018

qq 20180507090431
from Deep Learning using Linear Support Vector Machines (2013)
Multiple SVM is described in this picture. Output of Multiple SVM is defined in (9). There is no need to convert output margins of each binary SVM to 1 and -1. When more than one svm outputs a positive margin value, these positive margin are converted to 1 by using output = tf.identity(tf.sign(output), name='prediction'). correct_prediction = tf.equal(tf.argmax(output, 1), tf.argmax(y_input, 1)) may return a false value.

@AFAgarap
Copy link
Owner

AFAgarap commented May 7, 2018

The conversion to {+1, -1} is as per the SVM model design written by Vapnik and Cortes in their paper.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants