caffe icon indicating copy to clipboard operation
caffe copied to clipboard

how to do classification with SGD?

Open liguanbin opened this issue 12 years ago • 5 comments

hi, I am a newbie to caffe. I wanna do 2 class classification using caffe. I have lots of samples, say with 100 dimensions and each sample has a label, say 0 or 1. how can i get start to do this job? could anyone show me step by step including how to input my data into caffe? Thanks very much!

liguanbin avatar Jun 26 '14 10:06 liguanbin

have you got your own dataset ? once you're done with it...,lets caffe do the rest....

for example you can use Imagenet model

teknosains avatar Jun 28 '14 05:06 teknosains

my own dataset are some feature vectors (say, color histogram, HOG, SIFT...). may I make these data as input to caffe and do classification?

liguanbin avatar Jul 03 '14 05:07 liguanbin

@codetrash what do you mean by: let caffe do the rest? I tryed a binary classification task today, I took 1 class from the pascal2007 dataset (e.g. aeroplane), resized the images, calculated means for imgnet, generated the lvldb files (in my labeltext file it said 1 if aeroplane and 0 if not), then I changed the last fully connected layer of the imagenet protofile (i reduced the amount of outputs to 2) and called finetune. What I got was a loss of -nan. How one has to change the imgnet to make it available for differently sized classification tasks?

Best regards, Chris

wendlerc avatar Jul 07 '14 21:07 wendlerc

#644 it is sufficient.

wendlerc avatar Jul 08 '14 15:07 wendlerc

@liguanbin optimization isn't magic. While stochastic gradient descent is effective for many problems, perhaps remarkably so, there are still hyperparameters like learning rate, mini-batch size, and so on to tune.

A lesson on how to learn classifiers and do optimization by SGD is outside the scope of the project. Consult a good text, like Bottou's guide, or online tutorial.

shelhamer avatar Jul 14 '14 10:07 shelhamer