THMMY's "Optimization Techniques" course assignments.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

123456789101112131415161718192021222324
  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