matlab - Evolution strategy with individual stepsizes -
i'm trying find solution evolution strategy 30 dimensional minimization problem. have developed success simple (1,1) es , self-adaptive (1,lambda) es 1 step size.
the next step create (1,lambda) es individual stepsizes per dimension. problem matlab code doesn't work yet. i'm testing on sphere objective function:
function f = sphere(x) f = sum(x.^2); end
the plotted results of es 1 step size vs. 1 individual stepsizes:
the blue line performance of es individual step sizes , red 1 es 1 step size.
the code (1,lambda) es multiple stepsizes:
% strategy parameters tau = 1 / sqrt(2 * sqrt(n)); tau_prime = 1 / sqrt(2 * n); lambda = 10; % initialize xp = (ub - lb) .* rand(n, 1) + lb; sigmap = (ub - lb) / (3 * sqrt(n)); fp = feval(fitnessfct, xp'); evalcount = 1; % evolution cycle while evalcount <= stopeval % generate offsprings , evaluate = 1 : lambda rand_scalar = randn(); j = 1 : n osigma(j,i) = sigmap(j) .* exp(tau_prime * rand_scalar + tau * randn()); end o(:,i) = xp + osigma(:,i) .* rand(n,1); fo(i) = feval(fitnessfct, o(:,i)'); end evalcount = evalcount + lambda; % select best [~, sortindex] = sort(fo); xp = o(:,sortindex(1)); fp = fo(sortindex(1)); sigmap = osigma(:,sortindex(1)); end
does see problem?
your mutations have bias: can ever increase parameters, never decrease them. sigmap vector of (scaled) upper minus lower bounds: positive. exp(...) positive. therefore elements of osigma positive. change osigma .* rand(n,1), , rand(n,1) positive.
did perhaps mean use randn(n,1) instead of rand(n,1)? single-character change, find code optimizes rather pessimizing :-).
Comments
Post a Comment