THMMY's "Optimization Techniques" course assignments.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gamma_minimized.m 596 B

20 시간 전
12345678910111213141516171819
  1. function [gamma] = gamma_minimized(f, grad_f, x0)
  2. % Calculates the step based on minimizing f(xk​− γ*∇f(xk))
  3. %
  4. %
  5. % f: Objective function
  6. % grad_f: Gradient of objective function
  7. % x0: Initial (x,y) point
  8. % Define the line search function g(gamma) = f(x0 - gamma * grad)
  9. grad = grad_f(x0(1), x0(2));
  10. g = @(gamma) f(x0(1) - gamma * grad(1), x0(2) - gamma * grad(2));
  11. % Perform line search
  12. gamma = fminbnd(g, 0, 1);
  13. % ToDo: Check if we can use fmin_bisection_der
  14. % from the previous assigment here!
  15. end