Comments (8)
@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.
@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.
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.
@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.
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.
The paper is here
from cnn-svm.
Yes, I have read this article. Good results have been achieved in your code. Did you preprocess it?
from cnn-svm.
No, I didn't
from cnn-svm.
Related Issues (16)
- max nargin decision problem in code HOT 3
- Not able to create diretcory HOT 3
- 【Question】 How to import my own (training, testing) pictures HOT 6
- chore: implement cnn in tf2
- chore: implement cnn-svm in tf2
- chore: implement data handling functions
- chore: implement training function for cnn
- chore: implement cnn in pytorch
- chore: implement cnn-svm in pytorch HOT 1
- Can't run the training on the model for CNNSVM HOT 6
- About intrusion detection code
- pt_cnn_svm
- 【question】test_data HOT 1
- You are supposed to provide codes loading custo-made data HOT 1
- ModuleNotFoundError: No module named 'tensorflow.examples'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cnn-svm.