Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Digit Detection using Single Layer Perceptron in Matlab ame as ttribute 784x1000 784000 1000 3920000 test uint8 uint8 uint8 uint8 testlabels 1000x1 train 784x5000 trainlabels
Digit Detection using Single Layer Perceptron in Matlab
ame as ttribute 784x1000 784000 1000 3920000 test uint8 uint8 uint8 uint8 testlabels 1000x1 train 784x5000 trainlabels 5000x1 5000 The variable 'train' includes images of 5000 hand-written digits. However, to see images of these digits you should change 'train' from a 784 x 5000 to a variable such as 'x' which has the dimension of 28 x 28 x 5000. Then you will have five thousand 28 x 28 images of these digits. A simple way of doing this is: load digits.mat for k1:5000 dummy = train (:, k) ; for i 1:28 for j1:28 x (i,j,k)double (dummy (i-1) 28 j) en imagesc (x (,, k) ') colormap gray) colorbar pbaspect (I1 1 1]) pause (0.2) end The number associated with each digit in 'train' is given in 'trainlabels' In this project, you should design and train a single-layer 2-dimensional Perceptron to recognize these digits A. Design and train a single-layer 2-dimensional Perceptron that can detect the digit '0'. In other words, your Perceptron should return +1 when the digit in the image is '0' and -1 otherwise. Train your Perceptron with the 5000 images available in 'train' and test the performance of your system by using the other variable, 'test, in your data file. When you are training your Perceptron, simultaneously monitor the number of errors in the last 100 iterations. (Try to choose a reasonable value for your training rate and reduce it as a function of iteration number). How is the performance of the system? Also look at the image of your weights w which is a 28 x 28 variable vector. How does it look? Why? B. Repeat this experiment but this time try to detect digit '8'. Does your network perform better or worse? Why? Now try '1' and '2' ame as ttribute 784x1000 784000 1000 3920000 test uint8 uint8 uint8 uint8 testlabels 1000x1 train 784x5000 trainlabels 5000x1 5000 The variable 'train' includes images of 5000 hand-written digits. However, to see images of these digits you should change 'train' from a 784 x 5000 to a variable such as 'x' which has the dimension of 28 x 28 x 5000. Then you will have five thousand 28 x 28 images of these digits. A simple way of doing this is: load digits.mat for k1:5000 dummy = train (:, k) ; for i 1:28 for j1:28 x (i,j,k)double (dummy (i-1) 28 j) en imagesc (x (,, k) ') colormap gray) colorbar pbaspect (I1 1 1]) pause (0.2) end The number associated with each digit in 'train' is given in 'trainlabels' In this project, you should design and train a single-layer 2-dimensional Perceptron to recognize these digits A. Design and train a single-layer 2-dimensional Perceptron that can detect the digit '0'. In other words, your Perceptron should return +1 when the digit in the image is '0' and -1 otherwise. Train your Perceptron with the 5000 images available in 'train' and test the performance of your system by using the other variable, 'test, in your data file. When you are training your Perceptron, simultaneously monitor the number of errors in the last 100 iterations. (Try to choose a reasonable value for your training rate and reduce it as a function of iteration number). How is the performance of the system? Also look at the image of your weights w which is a 28 x 28 variable vector. How does it look? Why? B. Repeat this experiment but this time try to detect digit '8'. Does your network perform better or worse? Why? Now try '1' and '2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started