Git Product home page Git Product logo

Comments (8)

AFAgarap avatar AFAgarap commented on July 29, 2024

@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 : [0, 1, 0, 0] --> [-1, 1, -1, 1]

from cnn-svm.

anbo1024 avatar anbo1024 commented on July 29, 2024

@AFAgarap I still have some doubts.
1、You will [0, 1, 0, 0] --> [-1, 1, -1, 1],Softmax regards the maximum subscript as the final classification result. How do you determine the final classification result with this encoding method?
2、I think that in CNN, whether using SVM or Softmax, the network output has been classified. SVM and Softmax calculate loss in different ways.

output = tf.identity(tf.sign(output), name='prediction')
output = tf.identity((output), name='prediction')
correct_prediction = tf.equal(tf.argmax(output, 1), tf.argmax(y_input, 1))

I think tf. sign and tf. nn. softmax functions can be removed.The following Correct_prediction function already contains the maximum operation.
I hope I can get your advice. Thank you very much.

from cnn-svm.

AFAgarap avatar AFAgarap commented on July 29, 2024

Well, in terms of having a one-hot encoded vector with a -1 in place of 0, e.g. [-1, 1, -1, -1], which one is greater, -1 or 1? 1, yes? So, it's still fine to be there. But you're right, it can be discarded for the purposes of getting the training accuracy.

from cnn-svm.

anbo1024 avatar anbo1024 commented on July 29, 2024

@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?

from cnn-svm.

AFAgarap avatar AFAgarap commented on July 29, 2024

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.

from cnn-svm.

AFAgarap avatar AFAgarap commented on July 29, 2024

The paper is here

from cnn-svm.

anbo1024 avatar anbo1024 commented on July 29, 2024

Yes, I have read this article. Good results have been achieved in your code. Did you preprocess it?

from cnn-svm.

AFAgarap avatar AFAgarap commented on July 29, 2024

No, I didn't

from cnn-svm.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.