Can I adjust patternsearch meshsize using output function (during optimisation)?

조회 수: 2 (최근 30일)
I am trying to adjust the 'meshsize' between certain iterations of a patternsearch optimisation. The output functions provides access to the patternsearch options, however this does not provide the variable meshsize. The meshsize is located in the optimvalues structure which is read-only (as far as I am aware). Is there any way to modify this without restarting the optimisation afresh?
For context, I am using a 'dynamic' cost function which changes slightly and I want to prevent premature convergence (and ensure a good search). If not, I will have to try and figure out a smooth way to restart optimisation without creating too much of a mess.
Thanks for any help!
p.s. I tried adjusting the MeshContractionFactor and MeshExpansionFactor to both be scalars giving the desired meshSize regardless of the next poll outcome. However, MeshContractionFactor has to be between 0 and 1. So that won't work.
  댓글 수: 1
Robert Hamill
Robert Hamill 2023년 5월 23일
@Alan Weiss Sorry if tagging is not encouraged but having read a lot of the optimisation questions, I thought you may well know the answer to this question.

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

채택된 답변

Alan Weiss
Alan Weiss 2023년 5월 23일
Sorry to say, but a patternsearch output function does not allow you to change the mesh size. However, as I think you know, the output function does allow you to change options on the fly. But if you tried changing options already, which is what I think your comment on MeshContractionFactor is about, then I do not have any other ideas for you.
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Robert Hamill
Robert Hamill 2023년 6월 6일
Thanks Alan. Yes, I have decided to rework my approach to avoid resetting the mesh size.
For anyone reading in the future:
  • You could manually set MeshContractionFactor and MeshExpansionFactor, and also temporaily set a 'fake' function value in order to force the desired change in mesh size.
  • You could just restart the optimisation with a specified initial mesh size. (May be a pain in some cases).

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Direct Search에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by