a basic question about subgradient method

greetings, hi... here is what i'm dealing with...
  1. i need to test a program for subgradient method with several value of alpha.
  2. i have the program but i need to modify it a little bit..
  3. this is my template
function [x,hist] = sgm_pwl_nonsum_dimin(A,b,x1,a,MAX_ITERS)
% subgradient method for linear piecewise minimization
% uses nonsummable diminishing step size rule, **alpha_k = a/sqrt(k)**
f = [+Inf]; fbest = [+Inf];
k = 0;
x = x0;
while k < MAX_ITERS
% subgradient calculation
[fval,ind] = max(A*x+b);
g = A(ind,:)';
% step size selection
alpha = a/sqrt(k);
% store objective values
f(end+1) = fval;
fbest(end+1) = min( fval, fbest(end) );
% subgradient update
x = x - alpha*g; k = k + 1;
end
% collect history information
hist{1} = f; hist{2} = fbest;
My questions are
  1. I need to update the value of x (x_new=x_old-alpha*g)
  2. I need to find the difference between x_new and x_old
  3. Since the difference is in matrix and have a few elements, I need to find the min of x_new-x_old
  4. Same goes to subgradient, after finding one, I need to find the difference and find the max value .
How can I do that? thx

Respuestas (0)

Etiquetas

Preguntada:

el 24 de Dic. de 2014

Editada:

el 24 de Dic. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by