Mit18 S096iap23 Lec4
Mit18 S096iap23 Lec4
1
Newton’s method: Nonlinear equations via Linearization
scalar out scalar in
Courtesy of Ralf Pfeifer on Wikimedia. License: CC BY-SA. Some rights reserved. This content is excluded
from our Creative Commons license. For more information, see https://ocw.mit.edu/help/faq-fair-use.
2
Multidimensional Newton’s method: Real world is nonlinear!
vector out vector in
6
Engineering/physical optimization
© Source unknown. All rights reserved. This content is © Joris Laarman. All rights reserved. This content is
excluded from our Creative Commons license. For more excluded from our Creative Commons license. For more
information, see https://ocw.mit.edu/help/faq-fair-use. information, see https://ocw.mit.edu/help/faq-fair-use. 8
Adjoint differentiation
(yet another example of left-to-right/reverse-mode differentiation)
Example: gradient of scalar f(x(p)) where A(p)x=b, i.e. f(A(p)–1b)
Right-to-left (a.k.a. forward mode) better when 1 input & many outputs.
Left-to-right (a.k.a. backward mode, adjoint, backpropagation) better
when 1 output & many inputs
(Note: Using dual numbers is forward mode. Most AD uses the term
“forward” if it is forward mode. e.g. ForwardDiff.jl in Julia is forward mode.
jax.jacfwd in Python is forward mode.)
10
Don’t use finite differences with lots of parameters!
11
Adjoint differentiation with nonlinear equations
Example: gradient of scalar f(x(p)) where x(p) ∈ ℝⁿ solves g(p,x) = 0 ∈ ℝⁿ
For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.