fminunc with user-supplied gradient

조회 수: 3 (최근 30일)
Cy
Cy 2015년 9월 15일
댓글: Cy 2015년 9월 16일
Why is it that if I run fminunc with gradient supplied (return gradient in output, set 'GradObj' to 'on', etc) and print out the input variable for each call to the objective, I see the same value of the variable repeated multiple times (which seems to mean the same point is evaluated multiple times) before it changes/steps to the next point?
I would understand if it repeated multiple times, with perturbations for each variable component, to estimate the gradient, but in this case the gradient value/function is already supplied within the first call, and the values repeat exactly, not even with perturbation.
Any help with explaining this would be greatly appreciated because otherwise, on the surface, it just seems like several wasted function calls, but I have a feeling I'm missing something.
Thanks

채택된 답변

Matt J
Matt J 2015년 9월 15일
My guess would be that you are only displaying the values to 4 decimal places precision (MATLAB's default) and that if you displayed to higher precision, you would see that there are in fact small changes in the variable values. Failing that, you need to give us some way of reproducing what you are seeing.
  댓글 수: 2
Alan Weiss
Alan Weiss 2015년 9월 16일
I agree that your question has too little detail for us to comment effectively. Please give us your exact fminunc call and your exact fminunc options setup if you'd like more informative answers.
Alan Weiss
MATLAB mathematical toolbox documentation
Cy
Cy 2015년 9월 16일
You are right. I changed the display formatting and I can see the changes with a higher number of decimals. The changes were still occurring to estimate the Hessian.
Thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by