THMMY's "Optimization Techniques" course assignments.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

24 rindas
791 B

  1. function [gamma] = gamma_minimized(f, ~, dk, xk)
  2. % Calculates the step based on minimizing f(xk​− γk*dk)
  3. %
  4. %
  5. % f: Objective function
  6. % ~: Gradient function of f - Not used
  7. % dk: Current value of selected direction -∇f or -inv{H}*∇f or -inv{H + lI}*∇f
  8. % xk: Current point (x,y)
  9. % Define the line search function fmin(g) = f(xk - g * dk)
  10. fmin = @(g) f(xk) + g * dk;
  11. % find g that minimizes fmin
  12. e = 0.0001;
  13. l = 0.001;
  14. [a,b,k,~] = fmin_bisection(fmin, 0.0001, 1, e, l); % g in (0, 1]
  15. gamma = 0.5*(a(k) + b(k));
  16. % Define the line search function fmin(g) = f(xk - g * dk)
  17. %fmin = @(g) f(xk(1) - gamma * dk(1), xk(2) - gamma * dk(2));
  18. % find g that minimizes fmin
  19. %gamma = fminbnd(g, 0, 1);
  20. end