how to perform pattren recognition using MNIST data and single perceptron

3 views (last 30 days)
hello,
i have to write a single multiclass perceptron code in matlab for pattern classification of handwrritten digits. i have the MNIST training data set in form of a .mat file Each image in the database is a 28 x 28 gray scale image, all images are transformed to vectors of length 784. when i load the mat file it gives me 10,000 X 784 sparse matrix and a 10,000 X 1 vector of true values.
my task is to use 10 perceptron (single layer) for 10 digits classification. each perceptron have 784 inputs so 784 x1 input vector and 1x784 weight vector .For 10 classes (0 to 9) i creat a 10 X 784 Weight matrix. i initialize the Wght matrix with random numbers. the basic equation given to me is Y= W*transpose(trainsample vector) trainsample--> one sample of training data 1X784 vector
the code i write is
but when i run (for 10,000 times) the program run endlessly without stopping. kindly help me if i am doing some thing wrong
  2 Comments
khan
khan on 25 Feb 2015
You are correct, But if you are running it for 10000 times, it definitly takes alot of time. So you have to wait for it.
tir
tir on 25 Feb 2015
i have wrote a binary classifier for AND gate before but there i use hardlim function to get output and then compare it with desired one to calculate error. the weight is then updated as follows W=W+e.*P P is the input vector.
but here weight updation is not base on error calculation.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!