

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Problem set 2 for the computer vision course cap5415 at the university of central florida. The problem set includes five problems, covering topics such as log-likelihood calculation, gradient vector computation, and steepest descent optimization. Students are expected to complete each problem and submit their solutions by october 6, 2009.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


University of Central Florida
Problem Set 2 Fall 2009 Assigned: Friday, September 18, 2009 Due: Thursday, October 1, 2009 Note that because class will not be held on October 1, 2009, this problem set should be turned in on October 6, 2009. However, the next assignment will be released on October 1, 2009, so please plan accordingly.
Each of the sections below constitute one problem. If the problem asks for images, you should turn in a print-out with the requested images. Ideally, your assignment should be composed in a word-processor, such as LATEXor Microsoft Word. You are welcome to write out derivations by hand. In your writeup, described the steps you completed for each problem and show the results. Readability will be part of your grade. For the questions that require you to code, please turn in the code. Both Python and MATLAB versions of all files are available on the course webpage.
Given a set of N training examples x 1 ,... , xN , and labels l 1 ,... , lN the log-likelihood of the data is
∑^ N i=
log
( 1 + exp ( − li (xi · θ) )
)
Where θ is a vector of line parameters. Note that xi · θ is the vector inner product (or dot-product) between two vectors. In the files associated with this problem set, we have included data and labels. Complete the function calculate_log_loss(pts, labels), using the function header that we have provided as a starting point. To check your solution, we have gotten the following values in our implementation: θ L [0; 0; 1] 81. [1; 0; 1] 48. [1; 1; 1] 28. [1; 2; 2] 36.
If f (x, y) = (x − 2 y)^2 + (y − 60)^2 , compute the gradient vector of f.
Complete the framework code provided in grad_desc_mod.m to implement steepest descent optimiza- tion of the function from Problem 2. You should be able to achieve a value very close to zero. We have also included visualization code.
Using the vectors from Problem 1, we’ll assume that the components of x are denoted using additional subscripts, or xi = [xi, 1 xi, 2 xi, 3 ]. Derive the gradient vector ∇L with respect to each entry in the θ vector, or in other words, derive the equation for:
∂θ
∂L ∂θ ∂L 1 ∂θ 2 .. .
Complete the code framework provided in logistic_regression.m to implement steepest descent optimization of the classifier parameters. Again, we have included a visualization. For reference, you should be able to achieve values of L less than L = 1. 6 e 1. To implement the gradient calculations, you should complete the function calculate_gradient_log_loss.m, which is included with the files for this problem set. We have also included the function check_grad.m which you can use to numerically check your gradient function.