Notes for Conjugate Gradient Menthod

Notes for Conjugate Gradient Menthod

The Conjugate Gradient Methods is the most prominent iterative method for solving large (sparse) systems of linear equations of this form:

1:

Ax=b

2:

f(x)=12xTAxbTx+c

if A is symmetric and positive-definite, then f(x) is minimized by Ax=b(if not symmetric, then 12(AT+A)x=b)

The Solution to Ax=b Minimizes the Quadratic Form:

Supporse A is symmetric, Let x be a point that satisfies Ax=b, and e be an error term, then:

f(x+e)=12(x+e)TA(x+e)bT(x+e)c=12xTAx+eTAx+12eTAebTxbTe+c=f(x)+12eTAe

If A is positive-definite, then the latter term is positive for any e0, therefore x minimizes f(x)


The fact that f(x) is a paraboloid is our best intuition of what it means for a matrix to be positive-definite. if A is negative-definite——the result of negatiing a positive-definite matrix. A could be singular, in which case no solution is unique; the set of solutions is a line or a hyperplane having a uniform vale for f. if A is none of the above, then x is a saddle point, and techniques like Steepest Descent and CG will likely fail. The value of b and c determine where the minimum point of paraboloid lies, but do not affect the paraboloid's shape.
Alt text


Steepest Descent Method:

For the sake of most optimization problems have not closed-form solution, they usually tackles as iterative methods: Starting at some initial point x(0), then taking a series of steps x(1),x(2),..., until the stop condition is satisfied. So as Steepest Descent Method!
In Line search for setting step size, firstly obstains the step sieze α according to x(i+1)=x(i)+αr(i), where r(i)=bAx(i) is the residual in the iterative steps.
Totally, the method of Steepest Descent is:

r(i)=bAx(i),α(i)=rT(i)r(i)rT(i)Ar(i),x(i+1)=x(i)+αr(i)

The computational cost of Steepest Descent is dominated by matrx-vector products. There is a mathematical trick to avoid matrix-vector productation directly. See Equation 13 in An Introduction to the Conjugate Gradient Method Without the Agonizing Pain for detail.

The convergence rate is defined as:

f(x(i))f(x)f(x(0))f(x)=12eT(i)Ae(i)12eT(0)ATe(0)(κ1κ+1)2i

Alt text


The Method of Conjugate Directions:

Steepest Descent often finds itself taking steps in the same directions as earlier steps(remind the zigzag path, which appears because each gradient is orthogonal to the previous gradient). Conjugate Directions update each step via:

x(i+1)=x(i)+α(i)d(i)

d(i) is a set of orthogonal search directions d(0),d(1),...,d(n1). e(i+1)=ATxATx(i+1) is orthogonal to d(i), and that need never step in the same direction of d(i) again.
However, the solution x is unknown. The solution is to make the search directions A-orthogonal instead of orthogonal. Two vectors d(i) and d(j) are A-orthogonal/conjugate, if

dT(i)Ad(j)=0

The expression for α(i) turns to:

α(i)=dT(i)Ae(i)dT(i)Ad(i)=dT(i)r(i)dT(i)Ad(i)

If the search vector were the residual, then this formula would be identical to Steepest Descent.

After n iterations, every component of the error term is cut away, and e(n)=0:

e(i)=e(0)+i1j=0α(j)d(j)=n1j=0δ(j)d(j)i1j=0δ(j)d(j)=n1j=iδ(j)d(j)

The A-orthogonal search directions set d(i) could be found by conjugate Gram-Schmidt process, see Equation 36 in An Introduction to the Conjugate Gradient Method Without the Agonizing Pain for detail.


The Method of Conjugate Gradients:

References

  1. An Introduction to the Conjugate Gradient Method Without the Agonizing Pain
  2. Conjugate Gradient Method
  3. Nonlinear Conjugate Gradient Methods
  4. Gram-Schmidt process example
  5. Special Symbols
Notes%20for%20Conjugate%20Gradient%20Menthod%20%20%0A%3D%3D%3D%3D%3D%20%20%20%0A@%5Boptimization%20methods%7Cmachine%20learning%7Cpublished%5D%20%20%20%0A%0AThe%20Conjugate%20Gradient%20Methods%20is%20the%20most%20prominent%20iterative%20method%20for%20solving%20***large%20%28sparse%29%20systems%20of%20linear%20equations***%20of%20this%20form%3A%20%20%20%0A%0A%0A%5B1%5D%28http%3A//iver.postach.io/an-introduction-to-the-conjugate-gradient-menthod-without-the-agonizing-pain%231%29%3A%0A%24%24Ax%20%3D%20b%20%24%24%20%20%20%20%0A%0A%5B2%5D%28http%3A//iver.postach.io/an-introduction-to-the-conjugate-gradient-menthod-without-the-agonizing-pain%232%29%3A%20%20%0A%24%24f%28x%29%20%3D%20%5Cdfrac%7B1%7D%7B2%7Dx%5ETAx%20-%20b%5ETx%20+%20c%24%24%20%20%0Aif%20%24A%24%20is%20symmetric%20and%20positive-definite%2C%20then%20%24f%28x%29%24%20is%20minimized%20by%20%24Ax%20%3D%20b%24%28if%20not%20symmetric%2C%20then%20%24%5Cdfrac%7B1%7D%7B2%7D%28A%5ET%20+%20A%29x%20%3D%20b%24%29%20%20%0A%23%23%23%23The%20Solution%20to%20%24Ax%20%3D%20b%24%20Minimizes%20the%20Quadratic%20Form%3A%23%23%23%23%20%20%0ASupporse%20%24A%24%20is%20symmetric%2C%20Let%20x%20be%20a%20point%20that%20satisfies%20%24Ax%20%3D%20b%24%2C%20and%20%24e%24%20be%20an%20error%20term%2C%20then%3A%20%20%0A%24%24%0Af%28x+e%29%20%5C%5C%0A%3D%20%5Cdfrac%7B1%7D%7B2%7D%28x+e%29%5ETA%28x+e%29%20-%20b%5ET%28x+e%29%20-%20c%5C%5C%0A%3D%20%5Cdfrac%7B1%7D%7B2%7Dx%5ETAx%20+%20e%5ETAx%20+%20%5Cdfrac%7B1%7D%7B2%7De%5ETAe%20-%20b%5ETx%20-%20b%5ETe%20+%20c%20%5C%5C%0A%3D%20f%28x%29%20+%20%5Cdfrac%7B1%7D%7B2%7De%5ETAe%0A%24%24%20%20%0AIf%20%24A%24%20is%20positive-definite%2C%20then%20the%20latter%20term%20is%20positive%20for%20any%20%24e%20%5Cneq%200%24%2C%20therefore%20%24x%24%20minimizes%20%24f%28x%29%24%20%20%20%0A%0A-----%0A%0AThe%20fact%20that%20%24f%28x%29%24%20is%20a%20paraboloid%20is%20our%20best%20intuition%20of%20what%20it%20means%20for%20a%20matrix%20to%20be%20positive-definite.%20if%20A%20is%20negative-definite%u2014%u2014the%20result%20of%20negatiing%20a%20positive-definite%20matrix.%20A%20could%20be%20singular%2C%20in%20which%20case%20no%20solution%20is%20unique%3B%20the%20set%20of%20solutions%20is%20a%20line%20or%20a%20hyperplane%20having%20a%20uniform%20vale%20for%20%24f%24.%20if%20A%20is%20none%20of%20the%20above%2C%20then%20%24x%24%20is%20a%20saddle%20point%2C%20and%20techniques%20like%20Steepest%20Descent%20and%20CG%20will%20likely%20fail.%20The%20value%20of%20%24b%24%20and%20%24c%24%20determine%20where%20the%20minimum%20point%20of%20paraboloid%20lies%2C%20but%20do%20not%20affect%20the%20paraboloid%27s%20shape.%20%20%20%0A%21%5BAlt%20text%5D%28./1402302354447.png%29%0A%0A------%0A%23%23%23%23Steepest%20Descent%20Method%3A%20%20%0AFor%20the%20sake%20of%20most%20optimization%20problems%20have%20not%20closed-form%20solution%2C%20they%20usually%20tackles%20as%20iterative%20methods%3A%20Starting%20at%20some%20initial%20point%20%24x_%7B%280%29%7D%24%2C%20then%20taking%20a%20series%20of%20steps%20%24x_%7B%281%29%7D%2C%20x_%7B%282%29%7D%2C%20...%24%2C%20until%20the%20stop%20condition%20is%20satisfied.%20So%20as%20Steepest%20Descent%20Method%21%20%20%0AIn%20**Line%20search**%20for%20setting%20step%20size%2C%20firstly%20obstains%20the%20step%20sieze%20%24%5Calpha%24%20according%20to%20%24x_%7B%28i+1%29%7D%3Dx_%7B%28i%29%7D+%5Calpha%20r_%7B%28i%29%7D%24%2C%20where%20%24r_%7B%28i%29%7D%3Db%20-%20Ax_%7B%28i%29%7D%24%20is%20the%20residual%20in%20the%20iterative%20steps.%20%20%0ATotally%2C%20the%20method%20of%20Steepest%20Descent%20is%3A%20%20%0A%24%24%0A%20%20%20%20r_%7B%28i%29%7D%20%3D%20b%20-%20Ax_%7B%28i%29%7D%2C%20%5C%5C%0A%20%20%20%20%5Calpha_%7B%28i%29%7D%20%3D%20%5Cdfrac%7Br_%7B%28i%29%7D%5ETr_%7B%28i%29%7D%7D%7Br_%7B%28i%29%7D%5ETAr_%7B%28i%29%7D%7D%2C%20%5C%5C%0A%20%20%20%20x_%7B%28i+1%29%7D%20%3D%20x_%7B%28i%29%7D%20+%20%5Calpha%20r_%7B%28i%29%7D%0A%24%24%20%20%20%0AThe%20computational%20cost%20of%20Steepest%20Descent%20is%20dominated%20by%20matrx-vector%20products.%20%20There%20is%20a%20mathematical%20trick%20to%20avoid%20matrix-vector%20productation%20directly.%20See%20Equation%2013%20in%20%5BAn%20Introduction%20to%20the%20Conjugate%20Gradient%20Method%20Without%20the%20Agonizing%20Pain%5D%28http%3A//www.cs.cmu.edu/%7Equake-papers/painless-conjugate-gradient.pdf%29%20for%20detail.%20%20%0A%0AThe%20convergence%20rate%20is%20defined%20as%3A%20%20%20%0A%24%24%0A%20%20%20%20%5Cdfrac%7Bf%28x_%7B%28i%29%7D%29-f%28x%29%7D%7Bf%28x_%7B%280%29%7D%29-f%28x%29%7D%20%5C%5C%0A%20%20%20%20%3D%20%5Cdfrac%7B%5Cdfrac%7B1%7D%7B2%7De%5ET_%7B%28i%29%7DAe_%7B%28i%29%7D%7D%7B%5Cdfrac%7B1%7D%7B2%7De%5ET_%7B%280%29%7DA%5ETe_%7B%280%29%7D%7D%5C%5C%0A%20%20%20%20%5Cle%20%28%5Cdfrac%7B%5Ckappa-1%7D%7B%5Ckappa%20+%201%7D%29%5E%7B2i%7D%0A%24%24%20%20%20%0A%21%5BAlt%20text%5D%28./1402311119194.png%29%0A%0A------%0A%0A%23%23%23%23The%20Method%20of%20Conjugate%20Directions%3A%20%20%20%0ASteepest%20Descent%20often%20finds%20itself%20taking%20steps%20in%20the%20same%20directions%20as%20earlier%20steps%28remind%20the%20zigzag%20path%2C%20which%20appears%20because%20each%20gradient%20is%20orthogonal%20to%20the%20previous%20gradient%29.%20Conjugate%20Directions%20update%20each%20step%20via%3A%20%20%0A%24%24%0A%20%20%20%20x_%7B%28i+1%29%7D%3Dx_%7B%28i%29%7D%20+%20%5Calpha_%7B%28i%29%7Dd_%7B%28i%29%7D%0A%24%24%20%20%0A%24d_%7B%28i%29%7D%24%20is%20a%20set%20of%20orthogonal%20*search%20directions*%20%24d_%7B%280%29%7D%2C%20d_%7B%281%29%7D%2C%20...%2C%20d_%7B%28n-1%29%7D%24.%20%24e_%7B%28i+1%29%7D%3DA%5ETx-A%5ETx_%7B%28i+1%29%7D%24%20is%20orthogonal%20to%20%24d_%7B%28i%29%7D%24%2C%20and%20that%20need%20never%20step%20in%20the%20same%20direction%20of%20%24d_%7B%28i%29%7D%24%20again.%20%20%0AHowever%2C%20the%20solution%20%24x%24%20is%20unknown.%20The%20solution%20is%20to%20make%20the%20search%20directions%20*A*-orthogonal%20instead%20of%20orthogonal.%20Two%20vectors%20%24d_%7B%28i%29%7D%24%20and%20%24d_%7B%28j%29%7D%24%20are%20*A*-orthogonal/*conjugate*%2C%20if%20%0A%24%24%0A%20%20%20%20d_%7B%28i%29%7D%5ETAd_%7B%28j%29%7D%20%3D%200%0A%24%24%20%20%0AThe%20expression%20for%20%24%5Calpha_%7B%28i%29%7D%24%20turns%20to%3A%20%20%0A%24%24%0A%20%20%20%20%5Calpha_%7B%28i%29%7D%20%5C%5C%0A%20%20%20%20%3D%20-%20%5Cdfrac%7Bd_%7B%28i%29%7D%5ETAe_%7B%28i%29%7D%7D%7Bd_%7B%28i%29%7D%5ETAd_%7B%28i%29%7D%7D%20%5C%5C%0A%20%20%20%20%3D%20%5Cdfrac%7Bd_%7B%28i%29%7D%5ETr_%7B%28i%29%7D%7D%7Bd_%7B%28i%29%7D%5ETAd_%7B%28i%29%7D%7D%0A%24%24%20%20%0A%0AIf%20the%20search%20vector%20were%20the%20residual%2C%20then%20this%20formula%20would%20be%20identical%20to%20Steepest%20Descent.%20%20%0A%0A***After%20*n*%20iterations%2C%20every%20component%20of%20the%20error%20term%20is%20cut%20away%2C%20and%20%24e_%7B%28n%29%7D%3D0%24%3A***%20%20%0A%24%24%0A%20%20%20%20e_%7B%28i%29%7D%20%5C%5C%0A%20%20%20%20%3D%20e_%7B%280%29%7D%20+%20%5Csum_%7Bj%3D0%7D%5E%7Bi-1%7D%5Calpha_%7B%28j%29%7Dd_%7B%28j%29%7D%20%5C%5C%0A%20%20%20%20%3D%20%5Csum_%7Bj%3D0%7D%5E%7Bn-1%7D%5Cdelta_%7B%28j%29%7Dd_%7B%28j%29%7D%20-%20%5Csum_%7Bj%3D0%7D%5E%7Bi-1%7D%5Cdelta_%7B%28j%29%7Dd_%7B%28j%29%7D%20%5C%5C%0A%20%20%20%20%3D%20%5Csum_%7Bj%3Di%7D%5E%7Bn-1%7D%5Cdelta_%7B%28j%29%7Dd_%7B%28j%29%7D%0A%24%24%20%20%0AThe%20*A*-orthogonal%20search%20directions%20set%20%24%7Bd_%7B%28i%29%7D%7D%24%20could%20be%20found%20by%20*%5Bconjugate%20Gram-Schmidt%20process%5D%28https%3A//www.khanacademy.org/math/linear-algebra/alternate_bases/orthonormal_basis/v/linear-algebra--gram-schmidt-process-example%29*%2C%20see%20Equation%2036%20in%20%5BAn%20Introduction%20to%20the%20Conjugate%20Gradient%20Method%20Without%20the%20Agonizing%20Pain%5D%28http%3A//www.cs.cmu.edu/%7Equake-papers/painless-conjugate-gradient.pdf%29%20for%20detail.%20%20%0A%0A-----%0A%23%23%23%23The%20Method%20of%20Conjugate%20Gradients%3A%20%20%0A%0A%0A%23%23%23References%20%20%0A1.%20%5BAn%20Introduction%20to%20the%20Conjugate%20Gradient%20Method%20Without%20the%20Agonizing%20Pain%5D%28http%3A//www.cs.cmu.edu/%7Equake-papers/painless-conjugate-gradient.pdf%29%0A2.%20%5BConjugate%20Gradient%20Method%5D%28http%3A//www.stanford.edu/class/ee364b/lectures/conj_grad_slides.pdf%29%20%20%0A3.%20%5BNonlinear%20Conjugate%20Gradient%20Methods%5D%28ftp%3A//www.cc.ac.cn/pub/dyh/papers/CGoverview.pdf%29%20%20%0A4.%20%5BGram-Schmidt%20process%20example%5D%28https%3A//www.khanacademy.org/math/linear-algebra/alternate_bases/orthonormal_basis/v/linear-algebra--gram-schmidt-process-example%29%20%20%20%0A5.%20%5BSpecial%20Symbols%5D%28http%3A//www.math.harvard.edu/texman/node21.html%23SECTION00084000000000000000%29%0A%0A%0A%0A%0A%0A%0A


comments powered by Disqus