Problem Set 2 for Computer Vision Course CAP5415 at University of Central Florida - Prof. , Assignments of Computer Science

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

Pre 2010

Uploaded on 11/08/2009

koofers-user-u0d
koofers-user-u0d 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
University of Central Florida
CAP5415 - Computer Vision
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.
Introduction
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 L
A
T
E
Xor 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.
Problem 1
Given a set of Ntraining examples x1,...,xN, and labels l1, . . . , lNthe log-likelihood of the data is
L=
N
X
i=1
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.32
[1; 0; 1] 48.15
[1; 1; 1] 28.60
[1; 2; 2] 36.46
Problem 2
If f(x, y)=(x2y)2+ (y60)2, compute the gradient vector of f.
Problem 3
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.
1
pf2

Partial preview of the text

Download Problem Set 2 for Computer Vision Course CAP5415 at University of Central Florida - Prof. and more Assignments Computer Science in PDF only on Docsity!

University of Central Florida

CAP5415 - Computer Vision

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.

Introduction

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.

Problem 1

Given a set of N training examples x 1 ,... , xN , and labels l 1 ,... , lN the log-likelihood of the data is

L =

∑^ 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.

Problem 2

If f (x, y) = (x − 2 y)^2 + (y − 60)^2 , compute the gradient vector of f.

Problem 3

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.

Problem 4

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 ∂θ ∂L 1 ∂θ 2 .. .

  

Problem 5

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.