Question
i) Consider the last 4 digits of your mobile number (Note : In case there is a 0 in one of the digits replace it
i) Consider the last 4 digits of your mobile number (Note : In case there is a 0 in one of the digits replace it by 3). Let it be n1n2n3n4. Generate a random matrix A of size n1n2 ×n3n4. For example, if the last four digits are 2311, generate a random matrix of size 23 ×11. Write a code to calculate the l∞ norm of this matrix.
Deliverable(s) : The code that generates the results. (0.5)
ii) Generate a random vector b of size n1n2 ×1 and consider the function
f(x) = 1/2∥Ax −b∥22 where ∥ · ∥2 is the vector ℓ2 norm. Its gradient is given to be ∇f(x) = A⊤Ax −A⊤b. Write a code to find the local minima of this function by using the gradient descent algorithm (by using the gradient expression given to you). The step size τ in the iteration xk+1 = xk −τ∇f(xk) should be chosen by the formula
τ = gTk gk/gTk ATAgk where gk = ∇f(xk) = A⊤Axk −A⊤b. The algorithm should execute until ∥xk −xk−1∥2 < 10−4.
Deliverable(s) : The code that finds the minimum of the given function 2 and the expression for τ. The values of xk and f(xk) should be stored in a file. (1)
iii) Generate the graph of f(xk) vs k where k is the iteration number and xk is the current estimate of x at iteration k. This graph should convey the decreasing nature of function values.
Deliverable(s) : The graph that is generated
Step by Step Solution
3.49 Rating (159 Votes )
There are 3 Steps involved in it
Step: 1
Answer Explanation 03668 01765 00304 02217 02531 08154 00835 03939 08149 03215 01202 07395 01295 075...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