Merge pull request #1080 from JohannesPfeifer/CMAES_settings

Improve cmaes settings
time-shift
MichelJuillard 2015-10-11 20:44:10 +02:00
commit 7df7fe6fd8
4 changed files with 17 additions and 5 deletions

View File

@ -5280,6 +5280,10 @@ Available options are:
@table @code
@item 'CMAESResume'
Resume previous run. Requires the @code{variablescmaes.mat} from the last run.
Set to 1 to enable. Default: @code{0}
@item 'MaxIter'
Maximum number of iterations.

View File

@ -540,7 +540,7 @@ simplex.delta_factor=0.05;
options_.simplex = simplex;
% CMAES optimization routine.
cmaes.SaveVariables='off';
cmaes.SaveVariables='on';
cmaes.DispFinal='on';
cmaes.WarnOnEqualFunctionValues='no';
cmaes.DispModulo='10';
@ -548,6 +548,7 @@ cmaes.LogModulo='0';
cmaes.LogTime='0';
cmaes.TolFun = 1e-7;
cmaes.TolX = 1e-7;
cmaes.Resume = 0;
options_.cmaes = cmaes;
% simpsa optimization routine.

View File

@ -191,10 +191,10 @@ defopts.MaxFunEvals = 'Inf % maximal number of fevals';
defopts.MaxIter = '1e3*(N+5)^2/sqrt(popsize) % maximal number of iterations';
defopts.StopFunEvals = 'Inf % stop after resp. evaluation, possibly resume later';
defopts.StopIter = 'Inf % stop after resp. iteration, possibly resume later';
defopts.TolX = '1e-11*max(insigma) % stop if x-change smaller TolX';
defopts.TolX = '1e-9*max(insigma) % stop if x-change smaller TolX';
defopts.TolUpX = '1e3*max(insigma) % stop if x-changes larger TolUpX';
defopts.TolFun = '1e-12 % stop if fun-changes smaller TolFun';
defopts.TolHistFun = '1e-13 % stop if back fun-changes smaller TolHistFun';
defopts.TolFun = '1e-10 % stop if fun-changes smaller TolFun';
defopts.TolHistFun = '1e-11 % stop if back fun-changes smaller TolHistFun';
defopts.StopOnStagnation = 'on % stop when fitness stagnates for a long time';
defopts.StopOnWarnings = 'yes % ''no''==''off''==0, ''on''==''yes''==1 ';
defopts.StopOnEqualFunctionValues = '2 + N/3 % number of iterations';

View File

@ -302,8 +302,11 @@ switch minimizer_algorithm
[opt_par_values,fval,exitflag] = simplex_optimization_routine(objective_function,start_par_value,simplexOptions,parameter_names,varargin{:});
case 9
% Set defaults
H0 = 1e-4*ones(n_params,1);
H0 = (bounds(:,2)-bounds(:,1))*0.2;
H0(~isfinite(H0)) = 0.01;
cmaesOptions = options_.cmaes;
cmaesOptions.LBounds = bounds(:,1);
cmaesOptions.UBounds = bounds(:,2);
% Modify defaults
if ~isempty(options_.optim_opt)
options_list = read_key_value_string(options_.optim_opt);
@ -328,6 +331,10 @@ switch minimizer_algorithm
cmaesOptions.LogModulo = '0'; % [0:Inf] if >1 record data less frequently after gen=100';
cmaesOptions.LogTime = '0'; % [0:100] max. percentage of time for recording data';
end
case 'CMAESResume'
if options_list{i,2}==1
cmaesOptions.Resume = 'yes';
end
otherwise
warning(['cmaes: Unknown option (' options_list{i,1} ')!'])
end