Menu [hide]

Forum: 620-361 Operations Research Techniques & Algorithms

Forums->620-361 Operations Research Techniques & Algorithms->Step size for Armijo-Goldstein & Wolff conditions


cburt
Step size for Armijo-Goldstein & Wolff conditions


% Christina Burt - implementation of A Procedure to Find a Step Size that Satisfies The Armijo-Goldstein and Wolff Conditions
% 19th March 2008

function t = agw_step(f, fdash, T, sigma, mu)

% This function, agw_step implements a procedure to find a step size that satisfies
% the Armijo-Goldstein and Wolff Conditions for 1-D optimisation.

% The inputs for this function are:
% f : the 1-D function we wish to optimise. This function must be unimodal
% on [0,\infinity)
% f' : the derivative of the function f
% T : an initial step size
% sigma : an initial sigma value \in (0,1)
% mu : an initial mu value \in [sigma, 1)
% The output from this function is
% t : a step size that satisfies both the Armijo-Goldstein and Wolff conditions

f0 = feval(f,0);
fd0 = feval(fdash,0);

tlo = 0;
thi = 10000;
t = T;
counter = 0;

ft = feval(f,t);
fdt = feval(fdash,t);

while((ft > f0 + t*sigma*fd0)||(fdt < mu*fd0))
%add one to our counter
counter = counter + 1;

if(ft > f0 + t*sigma*fd0)
thi = t;
t = (tlo+t)/2;
elseif(fdt < mu*fd0)
tlo = t;
if(thi < 10000)
t = (tlo+thi)/2;
else
t = 2*t;
end
end
%re-calculate f(t) and f'(t) with our new t values
ft = feval(f,t);
fdt = feval(fdash,t);
end


%print the solution
sprintf('A step size that satisfied both conditions is %f',t)
sprintf('The algorithm found t in %f iterations.', counter)



 
on: Thu 20 of Mar, 2008 [01:04 UTC] reads: 247768

Posted messages

author message

achang
Re: Step size for Armijo-Goldstein & Wolff conditions
on: Thu 20 of Mar, 2008 [03:12 UTC]
% Last modified 20/3/2008
% Alan Chang

function t = AGWstep(f,fd,sigma,mu,T)

% Algorithm for obtaining a stepsize that satisfied the Armijo-Goldstein
% and Wolff conditions, given:
% f a unimodal function f(x) on [0,infinity)
% fd the derivative of f(x)
% sigma and mu have to be coefficients 0 < sigma 0 && sigma < 1 && mu >= sigma && mu < 1)
else
error('sigma and mu must satisfy 0 < sigma f(0) + t*sigma*fd(0))
t_hi = t;
t = (t_low+t_hi)/2;
end
if(fd(t) < mu*fd(0))
t_low = t;
% if(t_hi




Show posts:
Jump to forum:
RSS Wiki RSS Image Galleries RSS File Galleries RSS Forums
top of page