Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

thank you Write a MATLAB code to perform the following handwritten digit recognition computations. Step 01 Download the handwritten digit database USPS.mat from CANVAS and

image text in transcribed
image text in transcribed
thank you
Write a MATLAB code to perform the following handwritten digit recognition computations. Step 01 Download the handwritten digit database USPS.mat from CANVAS and load this file into your MATLAB session. (a) This file contains four arrays . train-patterns e test-patterns of size 256 x 4649 and train labels test labels of size 10 4649, You may find it helpful to think of these arrays as matrices. The arrays train-patterns and test-patterns contain a raster scan of the 16 x 16 gray level pixel intensities that have been normalized to lie within the range [-1,1. The arrays train.labels and test.labels contain the true information about the digit images. That is, if the jth handwritten digit image in train-patterns truly represents the digit i, then the i +1,j)th entry of train labels is +1, and all the other entries of the jth column of train labels are -1 (b) Now, display the first 16 images in train-patterns using subplot (4,4,k) and imagesc functions in MATLAB Print out the figure and include it in your Programming Project LaTeX and PDF files. Hint: You need to reshape each column into a matrix of size 16 x 16 followed by transposing it in order to display it correctly. Step 02 Read the description of this step in Chapter 10.01 of the textbook and/or Professor Saito's Lecture 21. Compute the mean digits in the train-patterns and put them in a matrix called train-aves of size 256 10, and display these 10 mean digit images using subplot (2,5,k) and imagesc. Print out the figure as a PDF file and include it in your LaTeX and PDF documents k10) using the Hint: You can gather (or pool) all the images in train-patterns corresponding to digit k- following MATLAB command >> train-patterns (:, train-labels(k, :)..1); Step 03 Read the description of this step in Chapter 10.01 of the textbook and/or Professor Saito's Lecture 21. Now conduct the simplest classification computations as follows. (a) First, prepare a matrix called test-classif of size 10 4649 and fill this matrix by computing the Euclidean distance (or its square) between each image in the test-patterns and each mean digit image in train aves Hint: the following line computes the squed Euclidean distances between all of the test digit images and the kth mean digit of the training dataset with one line of MATLAB code: > sum((test patterns-repmat (train aves(: ,k), 1 4649])).2); Write a MATLAB code to perform the following handwritten digit recognition computations. Step 01 Download the handwritten digit database USPS.mat from CANVAS and load this file into your MATLAB session. (a) This file contains four arrays . train-patterns e test-patterns of size 256 x 4649 and train labels test labels of size 10 4649, You may find it helpful to think of these arrays as matrices. The arrays train-patterns and test-patterns contain a raster scan of the 16 x 16 gray level pixel intensities that have been normalized to lie within the range [-1,1. The arrays train.labels and test.labels contain the true information about the digit images. That is, if the jth handwritten digit image in train-patterns truly represents the digit i, then the i +1,j)th entry of train labels is +1, and all the other entries of the jth column of train labels are -1 (b) Now, display the first 16 images in train-patterns using subplot (4,4,k) and imagesc functions in MATLAB Print out the figure and include it in your Programming Project LaTeX and PDF files. Hint: You need to reshape each column into a matrix of size 16 x 16 followed by transposing it in order to display it correctly. Step 02 Read the description of this step in Chapter 10.01 of the textbook and/or Professor Saito's Lecture 21. Compute the mean digits in the train-patterns and put them in a matrix called train-aves of size 256 10, and display these 10 mean digit images using subplot (2,5,k) and imagesc. Print out the figure as a PDF file and include it in your LaTeX and PDF documents k10) using the Hint: You can gather (or pool) all the images in train-patterns corresponding to digit k- following MATLAB command >> train-patterns (:, train-labels(k, :)..1); Step 03 Read the description of this step in Chapter 10.01 of the textbook and/or Professor Saito's Lecture 21. Now conduct the simplest classification computations as follows. (a) First, prepare a matrix called test-classif of size 10 4649 and fill this matrix by computing the Euclidean distance (or its square) between each image in the test-patterns and each mean digit image in train aves Hint: the following line computes the squed Euclidean distances between all of the test digit images and the kth mean digit of the training dataset with one line of MATLAB code: > sum((test patterns-repmat (train aves(: ,k), 1 4649])).2)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

3 The distinction between microeconomics and macroeconomics.

Answered: 1 week ago