Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

EE 429: Introduction to Machine Learning Fall 2021

Department of Electrical Engineering Marks: 10


University of Engineering and Technology New Campus Lahore Due date: January 03, 2021

Assignment 2 (CLO3)
Download the accompanying file of faces and read them one by one by storing them as columns
in a matrix X. Then, compute and subtract the mean in order for the rows to become zero-mean.
Perform an SVD to the matrix X, that is X = U ΣV T . In this way, the eigenfaces are the
columns of U . However, this needs a lot of computational effort because X has too many rows.
Alternatively, you can proceed as follows. First compute the product A = X T X and then the SVD
of A in order to compute the right singular vectors of X via A = V Σ2 V T . Then calculate each
eigenface according to ui = σ1i Xvi , where σi is the ith singular value of the SVD. In the sequel,
select one face at random in order to reconstruct it using the first 5, 30, 100, and 600 eigenvectors.

You might also like