필터 지우기
필터 지우기

Can I restart surrogateopt from earlier iterations with checkpoint file?

조회 수: 6 (최근 30일)
广志 满
广志 满 2023년 5월 6일
댓글: 广志 满 2023년 5월 9일
My surrogateopt stopped because of external program crash, and I'm sure several function evaluations near the crash is not reliable. Thus, I want to restart surrogateopt from earlier iterations rather than resuming from the itertaion that the checkpoint file ends. Is it possible?
  댓글 수: 2
广志 满
广志 满 2023년 5월 9일
I finally gave up this attempt and edited my code to save checkpoint file every iteration rather than overwrite it. The implementation is based on 'OutputFcn' in optimoptions. So next time I can restart the optimization process from any iteration.
广志 满
广志 满 2023년 5월 9일
options = optimoptions('surrogateopt','CheckpointFile','surrogateopt_check.mat','OutputFcn',@saveFcn);
and define saveFcn as
function stop = saveFcn(x,optimValues,state)
load 'surrogateopt_check.mat'
filename = 'check' + string(CheckPointData.BlackboxModelOptimizerData.state.iter) +'.mat';
save(filename,'CheckPointData');
stop = false;
end

댓글을 달려면 로그인하십시오.

답변 (1개)

Rakesh Kumar
Rakesh Kumar 2023년 5월 9일
I don't think of any easy way to do this.

카테고리

Help CenterFile Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by