Data fitting and optimization for machine learning · Lecture 25

Numerical Optimization for Machine Learning

Finding the minimum of a function when no formula gives it: golden-section search in one variable, gradient descent and the learning rate, Newton's method with curvature, and Gauss–Newton for nonlinear least squares. This is how machine-learning models are trained.

Md Mahbub E Noor · Assistant Professor
CSE-3107 Numerical Methods · B.Sc. 3rd Year 1st Semester
Department of CSE, University of Barishal

Why this lecture

The problem: who will pass the exam?

Ten students: hours of study xx and result yy (1 = pass, 0 = fail). Predict the probability of passing with a model p=σ(wx+b)p = \sigma(wx + b), where σ(z)=1/(1+e−z)\sigma(z) = 1/(1 + e^{-z}).

  • Best ww, bb: minimise the cross-entropy loss L(w,b)=−1n∑[yiln⁡pi+(1−yi)ln⁡(1−pi)]L(w, b) = -\frac1n\sum \big[y_i\ln p_i + (1 - y_i)\ln(1 - p_i)\big]
  • Setting ∂L/∂w=∂L/∂b=0\partial L/\partial w = \partial L/\partial b = 0 gives nonlinear equations with no closed-form solution
  • Least squares (Lectures 23–24) does not apply: the model is not linear in ww, bb
  • Neural networks: the same problem with millions of parameters
hours xxresult yy
0.5, 1.0, 1.50, 0, 0
2.0, 2.51, 0
3.0, 3.51, 0
4.0, 4.5, 5.01, 1, 1
ww, bb = ?boundary = ?
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
2 / 26

Today's goals

  • State optimality conditions and the link between minimisation and root finding
  • Apply golden-section search to a one-variable function
  • Apply gradient descent; explain the learning rate through stability
  • Apply Newton's method for minimisation and Gauss–Newton for nonlinear least squares
  • Train a logistic-regression classifier; choose a method for a given problem
Last time

Root finding (bisection, Newton, Lectures 6–10); iteration and convergence (Lecture 14); Euler stability (Lectures 21–22); least squares (Lectures 23–24).


Today

Minimise any smooth function by iteration: bracket it, walk downhill, or use curvature.

Data fitting and optimization for machine learning · you are hereBuilds on: L6, L9, L10, L14, L24
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
3 / 26
Start here

The idea in one picture

lowest pointrings = contour lines, like a map of a valleystarteach step: straight downhill (−gradient),length = learning rate η × slopeη too large: jumps across the valley,each time landing higher
A function of two variables drawn as a map: each ring is one height.Start anywhere. We want the bottom of the valley.Feel which way is steepest downhill and take a step that way.Look again from the new place, step again.The steps get shorter as the ground flattens.Keep going …… until the bottom: the minimum.If the steps are too long, each one jumps across the valley and lands higher. The learning rate matters.
In plain words
  • Training a model = finding the lowest point of an error surface
  • We cannot see the whole surface, only the slope where we stand
  • So step downhill, look again, and repeat
New words today
gradient ∇f
the direction of steepest uphill
learning rate η
the length of each step
minimum
a point with no downhill direction left
loss function
the error being minimised
Hessian H
the table of second derivatives (curvature)
convex
bowl-shaped: only one minimum
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
4 / 26

Working principle: a minimum is where the slope is zero and the curve bends up

One variable: necessary and sufficient conditionsf′(x∗)=0,f′′(x∗)>0f'(x^{*}) = 0, \qquad f''(x^{*}) > 0
Several variables: gradient zero, Hessian positive definite∇f(x∗)=0,H=[∂2f∂xi∂xj] positive definite\nabla f(\mathbf{x}^{*}) = \mathbf{0}, \qquad H = \Big[\frac{\partial^2 f}{\partial x_i\partial x_j}\Big] \text{ positive definite}
  • Minimising ff = finding a root of f′f': bisection and Newton (Lectures 6–10) apply to f′f'
  • But f′f' may be unknown or expensive: golden section uses only values of ff
  • Many variables: walk downhill along −∇f-\nabla f (gradient descent)
  • Local minimum ≠ global minimum unless ff is convex
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
5 / 26

Golden-section search: shrink a bracket without derivatives

f unimodal on [a, b]; two interior points, g = (√5 − 1)/2 ≈ 0.618c=b−g(b−a),d=a+g(b−a)c = b - g(b - a), \qquad d = a + g(b - a)
Keep the part that must contain the minimumf(c)<f(d)  ⇒  [a,d],f(c)≥f(d)  ⇒  [c,b]f(c) < f(d) \;\Rightarrow\; [a, d], \qquad f(c) \ge f(d) \;\Rightarrow\; [c, b]
  • Like bisection (Lecture 6), but compares two values instead of checking a sign
  • The kept interior point is reused: one new ff value per step, because g2=1−gg^2 = 1 - g
  • Bracket width × 0.618 each step: from 3 to 10−410^{-4} in 22 steps
  • Needs only a unimodal ff (one dip): no derivatives, very robust
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
6 / 26
The method, step by step

Golden-section search, step by step

  1. Choose a bracket [a,b][a, b] in which ff has a single minimum
  2. Place c=b−0.618(b−a)c = b - 0.618(b - a) and d=a+0.618(b−a)d = a + 0.618(b - a); evaluate f(c)f(c), f(d)f(d)
  3. If f(c)<f(d)f(c) < f(d): b←db \leftarrow d, d←cd \leftarrow c, new cc; otherwise a←ca \leftarrow c, c←dc \leftarrow d, new dd
  4. Evaluate ff only at the new point
  5. Stop when b−a<b - a < tolerance; answer (a+b)/2(a + b)/2

Store f(c)f(c) and f(d)f(d) so that each step costs one evaluation.

Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
7 / 26

Problem 1: minimise f(x)=x4−3x3+2f(x) = x^4 - 3x^3 + 2 on [0,3][0, 3]

1
c=3−0.618(3)=1.1459c = 3 - 0.618(3) = 1.1459,   d=1.8541\;d = 1.8541;   f(c)=−0.790\;f(c) = -0.790, f(d)=−5.304f(d) = -5.304
2
f(c)>f(d)f(c) > f(d): keep [1.1459,3][1.1459, 3]; new d=2.2918d = 2.2918, f(d)=−6.525f(d) = -6.525
3
Again f(c)>f(d)f(c) > f(d): keep [1.8541,3][1.8541, 3]; new d=2.5623d = 2.5623, f=−5.363f = -5.363
4
f(c)<f(d)f(c) < f(d): keep [1.8541,2.5623][1.8541, 2.5623], then [2.1246,2.5623][2.1246, 2.5623], …
5
After 22 steps: x∗=2.2500x^{*} = 2.2500, f(x∗)=−6.5430f(x^{*}) = -6.5430
Check: f′(x)=4x3−9x2=x2(4x−9)=0f'(x) = 4x^3 - 9x^2 = x^2(4x - 9) = 0 at x=2.25x = 2.25, f′′(2.25)=20.25>0f''(2.25) = 20.25 > 0: the method found the minimum using values of ff only.
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
8 / 26

Gradient descent: step downhill, scaled by the learning rate

Learning rate (step size) η > 0xk+1=xk−η ∇f(xk)\mathbf{x}_{k+1} = \mathbf{x}_k - \eta\,\nabla f(\mathbf{x}_k)
On f(w) = (w − 3)² + 1 the error is multiplied by (1 − 2η) each stepwk+1−3=(1−2η)(wk−3)w_{k+1} - 3 = (1 - 2\eta)(w_k - 3)
  • −∇f-\nabla f is the direction of steepest descent
  • From w0=0w_0 = 0: η=0.1\eta = 0.1: 0.6,1.08,1.46,…0.6, 1.08, 1.46, \dots (slow); η=0.5\eta = 0.5: 3 in one step; η=0.9\eta = 0.9: overshoots but converges
  • η=1\eta = 1: jumps 0,6,0,60, 6, 0, 6 for ever; η=1.1\eta = 1.1: diverges
  • It is Euler's method (Lecture 21) for x′=−∇f\mathbf{x}' = -\nabla f; stable when η<2/λmax⁡(H)\eta < 2/\lambda_{\max}(H), as in Lecture 22
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
9 / 26
The method, step by step

Gradient descent, step by step

  1. Start at x0\mathbf{x}_0; choose η\eta (try 0.1, then adjust by factors of 3)
  2. Compute the gradient g=∇f(xk)\mathbf{g} = \nabla f(\mathbf{x}_k)
  3. Step: xk+1=xk−ηg\mathbf{x}_{k+1} = \mathbf{x}_k - \eta\mathbf{g}
  4. Stop when ∥g∥\|\mathbf{g}\| or the change in ff is below a tolerance
  5. If ff increases, η\eta is too large: halve it. Momentum: v←βv−ηg\mathbf{v} \leftarrow \beta\mathbf{v} - \eta\mathbf{g},   x←x+v\;\mathbf{x} \leftarrow \mathbf{x} + \mathbf{v}

Machine learning: ∇f\nabla f from a random mini-batch of data = stochastic gradient descent.

Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
10 / 26

Problem 2: gradient descent on a long, narrow valley

Minimise f(x,y)=12(x2+10y2)f(x, y) = \tfrac12(x^2 + 10y^2) from (10,1)(10, 1). ∇f=(x,10y)\nabla f = (x, 10y); the Hessian has eigenvalues 1 and 10.
1
η=0.1\eta = 0.1: (10,1)→(10−1,1−1)=(9,0)→(8.1,0)→(7.29,0)…(10, 1) \to (10 - 1, 1 - 1) = (9, 0) \to (8.1, 0) \to (7.29, 0) \dots
2
Along xx the error shrinks only by 1−0.1(1)=0.91 - 0.1(1) = 0.9 per step: 153 steps to ∥x∥<10−6\|\mathbf{x}\| < 10^{-6}
3
Larger η\eta is limited by the steep direction: ∣1−10η∣<1⇒η<0.2|1 - 10\eta| < 1 \Rightarrow \eta < 0.2; at 0.2 yy flips sign for ever, at 0.21 it diverges
4
Best fixed rate η=2/(1+10)\eta = 2/(1 + 10): 81 steps. Momentum (η=0.1\eta = 0.1, β=0.5\beta = 0.5): 41 steps
Slow convergence is set by the condition number λmax⁡/λmin⁡=10\lambda_{\max}/\lambda_{\min} = 10 of the Hessian, just as for iterative linear solvers (Lecture 14).
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
11 / 26

Explore: gradient descent, momentum and Newton

  • Move η: zig-zag across the valley, then divergence above 0.2
  • Momentum smooths the zig-zag
  • Newton jumps to the minimum of a quadratic in one step
  • Rosenbrock's banana valley: GD crawls; Newton reaches (1,1)(1, 1) in 6 steps
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
12 / 26

Newton's method for minimisation: use the curvature

One variable: Newton (Lecture 9) applied to f′xk+1=xk−f′(xk)f′′(xk)x_{k+1} = x_k - \frac{f'(x_k)}{f''(x_k)}
Several variables: solve a linear system with the Hessian each stepH(xk) δ=−∇f(xk),xk+1=xk+δH(\mathbf{x}_k)\,\boldsymbol{\delta} = -\nabla f(\mathbf{x}_k), \qquad \mathbf{x}_{k+1} = \mathbf{x}_k + \boldsymbol{\delta}
  • Fits a parabola (quadratic model) at xk\mathbf{x}_k and jumps to its minimum
  • Quadratic convergence: f=x4−3x3+2f = x^4 - 3x^3 + 2 from 3: 2.5, 2.291667, 2.251462, 2.250002, 2.252.5,\ 2.291667,\ 2.251462,\ 2.250002,\ 2.25
  • Exact in one step for a quadratic ff (any condition number)
  • Cost: second derivatives and an n×nn \times n solve; can head for a maximum or saddle if HH is not positive definite
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
13 / 26

Gauss–Newton: nonlinear least squares by repeated linear least squares

Minimise S(p) = Σ rᵢ², residuals rᵢ = yᵢ − f(xᵢ; p); Jacobian Jᵢⱼ = ∂f(xᵢ; p)/∂pⱼ(JTJ) δ=JTr,p←p+δ\big(J^{T}J\big)\,\boldsymbol{\delta} = J^{T}\mathbf{r}, \qquad \mathbf{p} \leftarrow \mathbf{p} + \boldsymbol{\delta}
Bacteria (Lecture 24): f = a e^{bt}, columns of J∂f∂a=ebti,∂f∂b=a ti ebti\frac{\partial f}{\partial a} = e^{bt_i}, \qquad \frac{\partial f}{\partial b} = a\,t_i\,e^{bt_i}
  • Each step: linearise the model (Newton, Lecture 10), solve the normal equations (Lecture 23)
  • From the log-fit start (100.29,0.40767)(100.29, 0.40767): (100.436,0.407153)(100.436, 0.407153) in 2 steps
  • From a poor start (50,0.3)(50, 0.3): 94.7, 85.4, 96.4, 100.32, 100.436: converged by step 5
  • Levenberg–Marquardt adds λI\lambda I to JTJJ^{T}J for safety far from the answer
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
14 / 26

Problem 3: train the pass/fail classifier by gradient descent

1
Gradients: ∂L∂w=1n∑(pi−yi)xi\dfrac{\partial L}{\partial w} = \frac1n\sum (p_i - y_i)x_i,   ∂L∂b=1n∑(pi−yi)\;\dfrac{\partial L}{\partial b} = \frac1n\sum (p_i - y_i) (simple, like least squares)
2
Start w=b=0w = b = 0: all pi=0.5p_i = 0.5, L=ln⁡2=0.6931L = \ln 2 = 0.6931; gradient (−0.475,0)(-0.475, 0)
3
Step 1 (η=0.5\eta = 0.5): w=0.2375w = 0.2375, b=0b = 0, L=0.6458L = 0.6458
4
After 100 steps L=0.445L = 0.445; after 1000: w=1.3533w = 1.3533, b=−3.7214b = -3.7214, L=0.4335L = 0.4335
5
Newton's method on the same loss: 5 iterations to w=1.35341w = 1.35341, b=−3.72188b = -3.72188
p=σ(1.353x−3.722)p = \sigma(1.353x - 3.722): 50% chance at x=3.722/1.353≈2.75x = 3.722/1.353 \approx 2.75 hours; 27% after 2 hours, 73% after 3.5 hours.
Training log, learning rate 0.5
stepwwbbloss
0000.6931
10.237500.6458
100.3493−0.52600.5802
1001.0211−2.67950.4450
10001.3533−3.72140.4335

Gradient descent: cheap steps, many of them. Newton: 5 expensive steps.

Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
15 / 26
Classical vs numerical

Same goal, two approaches

Calculus

Classical (solve ∇f = 0 by hand)

  • f=x4−3x3+2f = x^4 - 3x^3 + 2: x2(4x−9)=0⇒x=2.25x^2(4x - 9) = 0 \Rightarrow x = 2.25
  • Least squares: ∇S=0\nabla S = 0 is linear (Lecture 23)
  • Needs equations that can be solved exactly
vs
Algorithm

Numerical (iterate downhill)

  • Golden section: 22 values of ff, no derivatives
  • Gradient descent or Newton: any differentiable ff
  • Same code for 2 or 10910^{9} parameters
When the classical approach cannot work

Training a neural network: minimise a loss over millions of weights

∇L=0\nabla L = 0 is a huge system of nonlinear equations with many solutions; nobody writes it down. Stochastic gradient descent (with momentum: Adam) takes millions of small steps, each using the gradient of a small batch of data computed by backpropagation.

Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
16 / 26

Golden section, Newton and gradient descent in code

  • Golden section on [0,3][0, 3] with one new ff per step
  • Newton's method on f′f' from x0=3x_0 = 3
  • Lab: logistic regression trained by gradient descent
  • Compare steps and accuracy of the two methods
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
17 / 26
When optimisation goes wrong

Limitations shown failing

  • Local minima: from (2,1)(2, 1) GD stops at x=1.347x = 1.347, f=−2.62f = -2.62; the deeper valley at x=−1.473x = -1.473 has f=−5.44f = -5.44
  • Learning rate: too small crawls, too large diverges (bowl presets)
  • Ill-conditioning: narrow valleys (Rosenbrock) make GD zig-zag for thousands of steps
  • Newton finds any stationary point, including maxima and saddles; golden section needs a single dip
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
18 / 26
Practice

Practice problem

Problem 4"For f(x,y)=x2+3y2−2xf(x, y) = x^2 + 3y^2 - 2x, perform two steps of gradient descent from (0,1)(0, 1) with η=0.1\eta = 0.1, then one step of Newton's method from (0,1)(0, 1). Compare with the exact minimum."
How to write a complete answer
  • ∇f=(2x−2,  6y)\nabla f = (2x - 2,\; 6y); at (0,1)(0, 1): (−2,6)(-2, 6)
  • Step 1: (0,1)−0.1(−2,6)=(0.2,0.4)(0, 1) - 0.1(-2, 6) = (0.2, 0.4), f=0.12f = 0.12;   \;Step 2: gradient (−1.6,2.4)(-1.6, 2.4) → (0.36,0.16)(0.36, 0.16), f=−0.5136f = -0.5136
  • Newton: H=[2006]H = \begin{bmatrix} 2 & 0 \\ 0 & 6 \end{bmatrix},   δ=−H−1∇f=(1,−1)\;\boldsymbol{\delta} = -H^{-1}\nabla f = (1, -1) → (1,0)(1, 0)
  • Exact minimum (1,0)(1, 0), f=−1f = -1: Newton is exact in one step because ff is quadratic; GD needs many steps
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
19 / 26
When to use it

Optimisation methods: profile

Best case
  • Golden section: one variable, no derivatives, guaranteed for unimodal ff
  • Gradient descent: huge numbers of parameters, cheap steps, works with noisy (stochastic) gradients
  • Newton / Gauss–Newton: few parameters, high accuracy in few steps
Worst case
  • Golden section: several variables, functions with many dips
  • Gradient descent: ill-conditioned valleys; sensitive to η
  • Newton: Hessian too large to form; non-convex regions
Best suited for
  • Tuning one hyperparameter (golden section on validation error)
  • Training ML models: linear, logistic, neural networks (SGD, Adam)
  • Curve fitting and calibration (Gauss–Newton, Levenberg–Marquardt)
Avoid when
  • Problems with a closed-form solution (linear least squares)
  • Non-smooth or discrete objectives (use specialised methods)
  • Constrained problems without modification (Lagrange multipliers, linear programming)

Rule of thumb: few variables and smooth: Newton or quasi-Newton; many variables or huge data: (stochastic) gradient descent with a tuned learning rate.

Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
20 / 26

Comparative analysis: optimisation methods

MethodUsesConvergenceCost per step (nn variables)Problem 1/2 result
Golden sectionff onlylinear, ×0.6181 evaluation22 steps to 10−410^{-4}
Newton (1-D)f′f', f′′f''quadratic2 derivative values4 steps to 10−610^{-6}
Gradient descent∇f\nabla flinear, set by condition numberO(n)O(n)153 steps (bowl, η=0.1\eta = 0.1)
GD + momentum∇f\nabla ffaster linearO(n)O(n)41 steps
Newton (nn-D)∇f\nabla f, HHquadraticO(n3)O(n^3) solve1 step (quadratic ff)
Gauss–Newtonresiduals, JJnear quadratic (small residuals)O(mn2)O(mn^2)2–5 steps (bacteria)

The trade-off is the same as in root finding (Lecture 10): cheap, slow, robust steps against expensive, fast, fragile ones.

Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
21 / 26
Beyond the classroom

The whole course inside a machine-learning library

🔢

Floating point (L2–5)

Training in 16-bit precision; loss of significance in softmax; why log-sum-exp is used

🎯

Roots and Newton (L6–10)

Newton and quasi-Newton optimisers; solving ∇f=0\nabla f = 0

🧮

Linear systems (L11–14)

Least squares, Cholesky in Gaussian processes, conditioning of features

📈

Interpolation (L15–18)

Splines for features and learning-rate schedules; Runge = overfitting

∫

Derivatives and integrals (L19–20)

Gradient checking with finite differences; expectations by quadrature

🌀

ODEs (L21–22)

Gradient descent = Euler; learning-rate limit = stability; neural ODEs

Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
22 / 26
Roadmap

End of the course: where these methods lead

Every method in this course has a bigger sibling. These are the natural next steps.

What you can now do
  • Know how computers store numbers and lose digits
  • Solve equations, linear systems and ODEs
  • Interpolate, differentiate and integrate data
  • Fit models and minimise functions
LimitationHow it is overcomeWhere
Millions of parameters, noisy gradients
→
SGD, Adam, backpropagation
Machine learning
Constraints (x≥0x \ge 0, budgets)
→
Lagrange multipliers, linear programming
Operations research
Equations in space and time (heat, waves, fluids)
→
Finite differences and finite elements
Numerical PDEs
Huge sparse matrices and eigenvalues
→
Krylov methods (CG, GMRES), SVD
Numerical linear algebra
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
23 / 26
Applications

Where this method runs in the real world

Click a card to see optimisation at work.

Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
24 / 26

Checkpoint

Checkpoint · think, then discuss with your neighbourGradient descent on f(w)=2w2f(w) = 2w^2 (f′(w)=4wf'(w) = 4w). For which learning rates does it converge?
A0<η<0.50 < \eta < 0.5
B0<η<10 < \eta < 1
C0<η<20 < \eta < 2
Devery η>0\eta > 0
A. wk+1=wk−4ηwk=(1−4η)wkw_{k+1} = w_k - 4\eta w_k = (1 - 4\eta)w_k; converges when ∣1−4η∣<1|1 - 4\eta| < 1, i.e. 0<η<0.50 < \eta < 0.5. At η=0.25\eta = 0.25 it reaches 0 in one step (η=1/f′′\eta = 1/f'', the Newton step).
Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
25 / 26

Summary

Key points
  • Minimum: ∇f=0\nabla f = 0 and HH positive definite; local ≠ global
  • Golden section: bracket × 0.618 per step, values of ff only
  • Gradient descent x←x−η∇f\mathbf{x} \leftarrow \mathbf{x} - \eta\nabla f; needs η<2/λmax⁡\eta < 2/\lambda_{\max}; speed set by the condition number; momentum helps
  • Newton: Hδ=−∇fH\boldsymbol\delta = -\nabla f, quadratic convergence; Gauss–Newton: (JTJ)δ=JTr(J^{T}J)\boldsymbol\delta = J^{T}\mathbf{r} for nonlinear least squares
Opening problem: solved

Gradient descent finds w=1.353w = 1.353, b=−3.722b = -3.722: p=σ(1.353x−3.722)p = \sigma(1.353x - 3.722). A student needs about 2.75 hours of study for a 50% chance of passing, and 73% after 3.5 hours.

Homework
  1. Golden-section search for the minimum of f(x)=x2−4sin⁡xf(x) = x^2 - 4\sin x on [0,3][0, 3]: three steps by hand, then finish in the lab.
  2. Gradient descent on f(x,y)=(x−1)2+4(y+2)2f(x, y) = (x - 1)^2 + 4(y + 2)^2 from (0,0)(0, 0): two steps with η=0.1\eta = 0.1. What is the largest stable η\eta?
  3. Newton's method for the minimum of f(x)=ex−2xf(x) = e^{x} - 2x from x0=0x_0 = 0: three iterations.
  4. Train the classifier of Problem 3 in the lab with η=0.1\eta = 0.1, 0.5 and 2: compare the loss after 100 steps.
After this course

Machine learning, optimisation, numerical PDEs and numerical linear algebra all build on these 25 lectures. Keep the labs: every method here is a few lines of code you can now read, check and trust.

Md Mahbub E Noor
Lecture 25: Optimization for machine learning
University of Barishal
26 / 26