Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC...

103
Convex Optimization (EE227A: UC Berkeley) Lecture 4 (Conjugates, subdifferentials) 31 Jan, 2013 Suvrit Sra

Transcript of Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC...

Page 1: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Convex Optimization(EE227A: UC Berkeley)

Lecture 4(Conjugates, subdifferentials)

31 Jan, 2013

Suvrit Sra

Page 2: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Organizational

♥ HW1 due: 14th Feb 2013 in class.

♥ Please LATEX your solutions (contact TA if this is an issue)

♥ Discussion with classmates is ok

♥ Each person must submit his/her individual solutions

♥ Acknowledge any help you receive

♥ Do not copy!

♥ Make sure you understand the solution you submit

♥ Cite any source that you use

♥ Have fun solving problems!

2 / 30

Page 3: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Recap

I Eigenvalues, singular values, positive definiteness

I Convex sets, θ1x+ θ2y ∈ C, θ1 + θ2 = 1, θi ≥ 0

I Convex functions, midpoint convex, recognizing convexity

I Norms, mixed-norms, matrix norms, dual norms

I Indicator, distance function, minimum of jointly convex

I Brief mention of other forms of convexity

f(x+y

2

)≤ 1

2 [f(x) + f(y)] + continuity =⇒ f is cvx

∇2f(x) � 0 implies f is cvx.

3 / 30

Page 4: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel Conjugate

4 / 30

Page 5: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Dual norms

Def. Let ‖·‖ be a norm on Rn. Its dual norm is

‖u‖∗ := sup{uTx | ‖x‖ ≤ 1

}.

Exercise: Verify that we may write‖u‖∗ = supx6=0uT x‖x‖

Exercise: Verify that ‖u‖∗ is a norm.

I ‖u+ v‖∗ = sup{(u+ v)Tx | ‖x‖ ≤ 1

}I But sup (A+B) ≤ supA+ supB

Exercise: Let 1/p+ 1/q = 1, where p, q ≥ 1. Show that ‖·‖q isdual to ‖·‖p. In particular, the `2-norm is self-dual.

Hint: Use Holder’s inequality: uT v ≤ ‖u‖p‖v‖q

5 / 30

Page 6: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Dual norms

Def. Let ‖·‖ be a norm on Rn. Its dual norm is

‖u‖∗ := sup{uTx | ‖x‖ ≤ 1

}.

Exercise: Verify that we may write‖u‖∗ = supx 6=0uT x‖x‖

Exercise: Verify that ‖u‖∗ is a norm.

I ‖u+ v‖∗ = sup{(u+ v)Tx | ‖x‖ ≤ 1

}I But sup (A+B) ≤ supA+ supB

Exercise: Let 1/p+ 1/q = 1, where p, q ≥ 1. Show that ‖·‖q isdual to ‖·‖p. In particular, the `2-norm is self-dual.

Hint: Use Holder’s inequality: uT v ≤ ‖u‖p‖v‖q

5 / 30

Page 7: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Dual norms

Def. Let ‖·‖ be a norm on Rn. Its dual norm is

‖u‖∗ := sup{uTx | ‖x‖ ≤ 1

}.

Exercise: Verify that we may write‖u‖∗ = supx 6=0uT x‖x‖

Exercise: Verify that ‖u‖∗ is a norm.

I ‖u+ v‖∗ = sup{(u+ v)Tx | ‖x‖ ≤ 1

}I But sup (A+B) ≤ supA+ supB

Exercise: Let 1/p+ 1/q = 1, where p, q ≥ 1. Show that ‖·‖q isdual to ‖·‖p. In particular, the `2-norm is self-dual.

Hint: Use Holder’s inequality: uT v ≤ ‖u‖p‖v‖q

5 / 30

Page 8: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Dual norms

Def. Let ‖·‖ be a norm on Rn. Its dual norm is

‖u‖∗ := sup{uTx | ‖x‖ ≤ 1

}.

Exercise: Verify that we may write‖u‖∗ = supx 6=0uT x‖x‖

Exercise: Verify that ‖u‖∗ is a norm.

I ‖u+ v‖∗ = sup{(u+ v)Tx | ‖x‖ ≤ 1

}I But sup (A+B) ≤ supA+ supB

Exercise: Let 1/p+ 1/q = 1, where p, q ≥ 1. Show that ‖·‖q isdual to ‖·‖p. In particular, the `2-norm is self-dual.

Hint: Use Holder’s inequality: uT v ≤ ‖u‖p‖v‖q

5 / 30

Page 9: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Dual norms

Def. Let ‖·‖ be a norm on Rn. Its dual norm is

‖u‖∗ := sup{uTx | ‖x‖ ≤ 1

}.

Exercise: Verify that we may write‖u‖∗ = supx 6=0uT x‖x‖

Exercise: Verify that ‖u‖∗ is a norm.

I ‖u+ v‖∗ = sup{(u+ v)Tx | ‖x‖ ≤ 1

}I But sup (A+B) ≤ supA+ supB

Exercise: Let 1/p+ 1/q = 1, where p, q ≥ 1. Show that ‖·‖q isdual to ‖·‖p. In particular, the `2-norm is self-dual.

Hint: Use Holder’s inequality: uT v ≤ ‖u‖p‖v‖q

5 / 30

Page 10: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Dual norms

Def. Let ‖·‖ be a norm on Rn. Its dual norm is

‖u‖∗ := sup{uTx | ‖x‖ ≤ 1

}.

Exercise: Verify that we may write‖u‖∗ = supx 6=0uT x‖x‖

Exercise: Verify that ‖u‖∗ is a norm.

I ‖u+ v‖∗ = sup{(u+ v)Tx | ‖x‖ ≤ 1

}I But sup (A+B) ≤ supA+ supB

Exercise: Let 1/p+ 1/q = 1, where p, q ≥ 1. Show that ‖·‖q isdual to ‖·‖p. In particular, the `2-norm is self-dual.

Hint: Use Holder’s inequality: uT v ≤ ‖u‖p‖v‖q

5 / 30

Page 11: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖); →∞I Case (ii): Since zTx ≤ ‖x‖‖z‖∗, xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 12: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖); →∞I Case (ii): Since zTx ≤ ‖x‖‖z‖∗, xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 13: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖); →∞I Case (ii): Since zTx ≤ ‖x‖‖z‖∗, xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 14: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖); →∞I Case (ii): Since zTx ≤ ‖x‖‖z‖∗, xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 15: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖); →∞I Case (ii): Since zTx ≤ ‖x‖‖z‖∗, xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 16: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖); →∞I Case (ii): Since zTx ≤ ‖x‖‖z‖∗, xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 17: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖);

→∞I Case (ii): Since zTx ≤ ‖x‖‖z‖∗, xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 18: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖); →∞

I Case (ii): Since zTx ≤ ‖x‖‖z‖∗, xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 19: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖); →∞I Case (ii): Since zTx ≤ ‖x‖‖z‖∗,

xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 20: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖); →∞I Case (ii): Since zTx ≤ ‖x‖‖z‖∗, xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.

I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 21: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖); →∞I Case (ii): Since zTx ≤ ‖x‖‖z‖∗, xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.

I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 22: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Def. The Fenchel conjugate of a function f is

f∗(z) := supx∈dom f

xT z − f(x).

Note: f∗ pointwise (over x) sup of linear functions of z, so cvx!

Example Let f(x) = ‖x‖. We have f∗(z) = I‖·‖∗≤1(z). That is,conjugate of norm is the indicator function of dual norm ball.

I Consider two cases: (i) ‖z‖∗ > 1; (ii) ‖z‖∗ ≤ 1

I Case (i), by definition of dual norm (sup over zTu) there is a u s.t.‖u‖ ≤ 1 and zTu > 1

I f∗(z) = supx xT z − f(x). Rewrite x = αu, and let α→∞

I Then, zTx− ‖x‖ = αzTu− ‖αu‖ = α(zTu− ‖u‖); →∞I Case (ii): Since zTx ≤ ‖x‖‖z‖∗, xT z − ‖x‖ ≤ ‖x‖(‖z‖∗ − 1) ≤ 0.I x = 0 maximizes ‖x‖(‖z‖∗ − 1), hence f(z) = 0.I Thus, f(z) = +∞ if (i), and 0 if (ii), as desired.

6 / 30

Page 23: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Example f(x) = ax+ b; then,

f∗(z) = supxzx− (ax+ b)

= ∞, if (z − a) 6= 0.

Thus, dom f∗ = {a}, and f∗(a) = −b.

Example Let a ≥ 0, and set f(x) = −√a2 − x2 if |x| ≤ a, and +∞

otherwise. Then, f∗(z) = a√1 + z2.

Example f(x) = 12x

TAx, where A � 0. Then, f∗(z) = 12z

TA−1z.

Exercise: If f(x) = max(0, 1− x), then dom f∗ is [−1, 0], andwithin this domain, f∗(z) = z.

Hint: Analyze cases: max(0, 1− x) = 0; andmax(0, 1− x) = 1− x

7 / 30

Page 24: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Example f(x) = ax+ b; then,

f∗(z) = supxzx− (ax+ b)

= ∞, if (z − a) 6= 0.

Thus, dom f∗ = {a}, and f∗(a) = −b.

Example Let a ≥ 0, and set f(x) = −√a2 − x2 if |x| ≤ a, and +∞

otherwise. Then, f∗(z) = a√1 + z2.

Example f(x) = 12x

TAx, where A � 0. Then, f∗(z) = 12z

TA−1z.

Exercise: If f(x) = max(0, 1− x), then dom f∗ is [−1, 0], andwithin this domain, f∗(z) = z.

Hint: Analyze cases: max(0, 1− x) = 0; andmax(0, 1− x) = 1− x

7 / 30

Page 25: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Example f(x) = ax+ b; then,

f∗(z) = supxzx− (ax+ b)

= ∞, if (z − a) 6= 0.

Thus, dom f∗ = {a}, and f∗(a) = −b.

Example Let a ≥ 0, and set f(x) = −√a2 − x2 if |x| ≤ a, and +∞

otherwise. Then, f∗(z) = a√1 + z2.

Example f(x) = 12x

TAx, where A � 0. Then, f∗(z) = 12z

TA−1z.

Exercise: If f(x) = max(0, 1− x), then dom f∗ is [−1, 0], andwithin this domain, f∗(z) = z.

Hint: Analyze cases: max(0, 1− x) = 0; andmax(0, 1− x) = 1− x

7 / 30

Page 26: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Example f(x) = ax+ b; then,

f∗(z) = supxzx− (ax+ b)

= ∞, if (z − a) 6= 0.

Thus, dom f∗ = {a}, and f∗(a) = −b.

Example Let a ≥ 0, and set f(x) = −√a2 − x2 if |x| ≤ a, and +∞

otherwise. Then, f∗(z) = a√1 + z2.

Example f(x) = 12x

TAx, where A � 0. Then, f∗(z) = 12z

TA−1z.

Exercise: If f(x) = max(0, 1− x), then dom f∗ is [−1, 0], andwithin this domain, f∗(z) = z.

Hint: Analyze cases: max(0, 1− x) = 0; andmax(0, 1− x) = 1− x

7 / 30

Page 27: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Example f(x) = ax+ b; then,

f∗(z) = supxzx− (ax+ b)

= ∞, if (z − a) 6= 0.

Thus, dom f∗ = {a}, and f∗(a) = −b.

Example Let a ≥ 0, and set f(x) = −√a2 − x2 if |x| ≤ a, and +∞

otherwise. Then, f∗(z) = a√1 + z2.

Example f(x) = 12x

TAx, where A � 0. Then, f∗(z) = 12z

TA−1z.

Exercise: If f(x) = max(0, 1− x), then dom f∗ is [−1, 0], andwithin this domain, f∗(z) = z.

Hint: Analyze cases: max(0, 1− x) = 0; andmax(0, 1− x) = 1− x

7 / 30

Page 28: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Fenchel conjugate

Example f(x) = ax+ b; then,

f∗(z) = supxzx− (ax+ b)

= ∞, if (z − a) 6= 0.

Thus, dom f∗ = {a}, and f∗(a) = −b.

Example Let a ≥ 0, and set f(x) = −√a2 − x2 if |x| ≤ a, and +∞

otherwise. Then, f∗(z) = a√1 + z2.

Example f(x) = 12x

TAx, where A � 0. Then, f∗(z) = 12z

TA−1z.

Exercise: If f(x) = max(0, 1− x), then dom f∗ is [−1, 0], andwithin this domain, f∗(z) = z.

Hint: Analyze cases: max(0, 1− x) = 0; andmax(0, 1− x) = 1− x

7 / 30

Page 29: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subdifferentials

8 / 30

Page 30: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

First order global underestimator

f(y)

y x

f(x)

f(y) +〈∇f(

y), x− y〉

f(x) ≥ f(y) + 〈∇f(y), x− y〉

9 / 30

Page 31: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

First order global underestimator

y

f(y)

g1

g2g3

f(y)+ 〈g1,

x− y〉

f(x)

f(x) ≥ f(y) + 〈g, x− y〉

9 / 30

Page 32: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients

y

f(y)

g1

g2g3

f(y)+ 〈g1,

x− y〉

f(x)

g1, g2, g3 are subgradients at y

10 / 30

Page 33: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients – basic facts

I f is convex, differentiable: ∇f(y) the unique subgradient at y

I A vector g is a subgradient at a point y if and only iff(y) + 〈g, x− y〉 is globally smaller than f(x).

I Usually, one subgradient costs approx. as much as f(x)

I Determining all subgradients at a given point — difficult.

I Subgradient calculus—a great achievement in convex analysis

I Without convexity, things become wild! — advanced course

11 / 30

Page 34: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients – basic facts

I f is convex, differentiable: ∇f(y) the unique subgradient at y

I A vector g is a subgradient at a point y if and only iff(y) + 〈g, x− y〉 is globally smaller than f(x).

I Usually, one subgradient costs approx. as much as f(x)

I Determining all subgradients at a given point — difficult.

I Subgradient calculus—a great achievement in convex analysis

I Without convexity, things become wild! — advanced course

11 / 30

Page 35: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients – basic facts

I f is convex, differentiable: ∇f(y) the unique subgradient at y

I A vector g is a subgradient at a point y if and only iff(y) + 〈g, x− y〉 is globally smaller than f(x).

I Usually, one subgradient costs approx. as much as f(x)

I Determining all subgradients at a given point — difficult.

I Subgradient calculus—a great achievement in convex analysis

I Without convexity, things become wild! — advanced course

11 / 30

Page 36: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients – example

f(x) := max(f1(x), f2(x)); both f1, f2 convex, differentiable

12 / 30

Page 37: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients – example

f(x) := max(f1(x), f2(x)); both f1, f2 convex, differentiable

f1(x)

12 / 30

Page 38: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients – example

f(x) := max(f1(x), f2(x)); both f1, f2 convex, differentiable

f1(x)

f2(x)

12 / 30

Page 39: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients – example

f(x) := max(f1(x), f2(x)); both f1, f2 convex, differentiable

f1(x)

f2(x)

f(x)

12 / 30

Page 40: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients – example

f(x) := max(f1(x), f2(x)); both f1, f2 convex, differentiable

f1(x)

f2(x)

f(x)

y

12 / 30

Page 41: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients – example

f(x) := max(f1(x), f2(x)); both f1, f2 convex, differentiable

f1(x)

f2(x)

f(x)

y

? f1(x) > f2(x): unique subgradient of f is f ′1(x)

? f1(x) < f2(x): unique subgradient of f is f ′2(x)

? f1(y) = f2(y): subgradients, the segment [f ′1(y), f′2(y)]

(imagine all supporting lines turning about point y)

12 / 30

Page 42: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients – example

f(x) := max(f1(x), f2(x)); both f1, f2 convex, differentiable

f1(x)

f2(x)

f(x)

y

? f1(x) > f2(x): unique subgradient of f is f ′1(x)

? f1(x) < f2(x): unique subgradient of f is f ′2(x)

? f1(y) = f2(y): subgradients, the segment [f ′1(y), f′2(y)]

(imagine all supporting lines turning about point y)

12 / 30

Page 43: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients – example

f(x) := max(f1(x), f2(x)); both f1, f2 convex, differentiable

f1(x)

f2(x)

f(x)

y

? f1(x) > f2(x): unique subgradient of f is f ′1(x)

? f1(x) < f2(x): unique subgradient of f is f ′2(x)

? f1(y) = f2(y): subgradients, the segment [f ′1(y), f′2(y)]

(imagine all supporting lines turning about point y)

12 / 30

Page 44: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradients

Def. A vector g ∈ Rn is called a subgradient at a point y, if for all

x ∈ dom f , it holds that

f(x) ≥ f(y) + 〈g, x− y〉

13 / 30

Page 45: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subdifferential

Def. The set of all subgradients at y denoted by ∂f(y). This set iscalled subdifferential of f at y

If f is convex, ∂f(x) is nice:

♣ If x ∈ relative interior of dom f , then ∂f(x) nonempty

♣ If f differentiable at x, then ∂f(x) = {∇f(x)}♣ If ∂f(x) = {g}, then f is differentiable and g = ∇f(x)

14 / 30

Page 46: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subdifferential

Def. The set of all subgradients at y denoted by ∂f(y). This set iscalled subdifferential of f at y

If f is convex, ∂f(x) is nice:

♣ If x ∈ relative interior of dom f , then ∂f(x) nonempty

♣ If f differentiable at x, then ∂f(x) = {∇f(x)}♣ If ∂f(x) = {g}, then f is differentiable and g = ∇f(x)

14 / 30

Page 47: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subdifferential

Def. The set of all subgradients at y denoted by ∂f(y). This set iscalled subdifferential of f at y

If f is convex, ∂f(x) is nice:

♣ If x ∈ relative interior of dom f , then ∂f(x) nonempty

♣ If f differentiable at x, then ∂f(x) = {∇f(x)}

♣ If ∂f(x) = {g}, then f is differentiable and g = ∇f(x)

14 / 30

Page 48: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subdifferential

Def. The set of all subgradients at y denoted by ∂f(y). This set iscalled subdifferential of f at y

If f is convex, ∂f(x) is nice:

♣ If x ∈ relative interior of dom f , then ∂f(x) nonempty

♣ If f differentiable at x, then ∂f(x) = {∇f(x)}♣ If ∂f(x) = {g}, then f is differentiable and g = ∇f(x)

14 / 30

Page 49: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subdifferential – example

f(x) = |x|

∂f(x)

−1

+1

x

∂|x| =

−1 x < 0,

+1 x > 0,

[−1, 1] x = 0.

15 / 30

Page 50: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subdifferential – example

f(x) = |x|

∂f(x)

−1

+1

x

∂|x| =

−1 x < 0,

+1 x > 0,

[−1, 1] x = 0.

15 / 30

Page 51: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subdifferential – example

f(x) = |x|

∂f(x)

−1

+1

x

∂|x| =

−1 x < 0,

+1 x > 0,

[−1, 1] x = 0.

15 / 30

Page 52: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

More examples

Example f(x) = ‖x‖2. Then,

∂f(x) :=

{‖x‖−12 x x 6= 0,

{z | ‖z‖2 ≤ 1} x = 0.

Proof.

‖z‖2 ≥ ‖x‖2 + 〈g, z − x〉‖z‖2 ≥ 〈g, z〉

=⇒ ‖g‖2 ≤ 1.

16 / 30

Page 53: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

More examples

Example f(x) = ‖x‖2. Then,

∂f(x) :=

{‖x‖−12 x x 6= 0,

{z | ‖z‖2 ≤ 1} x = 0.

Proof.

‖z‖2 ≥ ‖x‖2 + 〈g, z − x〉

‖z‖2 ≥ 〈g, z〉=⇒ ‖g‖2 ≤ 1.

16 / 30

Page 54: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

More examples

Example f(x) = ‖x‖2. Then,

∂f(x) :=

{‖x‖−12 x x 6= 0,

{z | ‖z‖2 ≤ 1} x = 0.

Proof.

‖z‖2 ≥ ‖x‖2 + 〈g, z − x〉‖z‖2 ≥ 〈g, z〉

=⇒ ‖g‖2 ≤ 1.

16 / 30

Page 55: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

More examples

Example f(x) = ‖x‖2. Then,

∂f(x) :=

{‖x‖−12 x x 6= 0,

{z | ‖z‖2 ≤ 1} x = 0.

Proof.

‖z‖2 ≥ ‖x‖2 + 〈g, z − x〉‖z‖2 ≥ 〈g, z〉

=⇒ ‖g‖2 ≤ 1.

16 / 30

Page 56: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

More examples

Example A convex function need not be subdifferentiable everywhere.Let

f(x) :=

{−(1− ‖x‖22)1/2 if ‖x‖2 ≤ 1,

+∞ otherwise.

f diff. for all x with ‖x‖2 < 1, but ∂f(x) = ∅ whenever ‖x‖2 ≥ 1.

17 / 30

Page 57: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Calculus

18 / 30

Page 58: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Recall basic calculus

If f and k are differentiable, we know that

Addition: ∇(f + k)(x) = ∇f(x) +∇k(x)Scaling: ∇(αf(x)) = α∇f(x)

Chain rule

If f : Rn → Rm, and k : Rm → Rp. Let h : Rn → Rp be thecomposition h(x) = (k ◦ f)(x) = k(f(x)). Then,

Dh(x) = Dk(f(x))Df(x).

Example If f : Rn → R and k : R → R, then using the fact that∇h(x) = [Dh(x)]T , we obtain

∇h(x) = k′(f(x))∇f(x).

19 / 30

Page 59: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Recall basic calculus

If f and k are differentiable, we know that

Addition: ∇(f + k)(x) = ∇f(x) +∇k(x)Scaling: ∇(αf(x)) = α∇f(x)

Chain rule

If f : Rn → Rm, and k : Rm → Rp. Let h : Rn → Rp be thecomposition h(x) = (k ◦ f)(x) = k(f(x)). Then,

Dh(x) = Dk(f(x))Df(x).

Example If f : Rn → R and k : R → R, then using the fact that∇h(x) = [Dh(x)]T , we obtain

∇h(x) = k′(f(x))∇f(x).

19 / 30

Page 60: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Recall basic calculus

If f and k are differentiable, we know that

Addition: ∇(f + k)(x) = ∇f(x) +∇k(x)Scaling: ∇(αf(x)) = α∇f(x)

Chain rule

If f : Rn → Rm, and k : Rm → Rp. Let h : Rn → Rp be thecomposition h(x) = (k ◦ f)(x) = k(f(x)). Then,

Dh(x) = Dk(f(x))Df(x).

Example If f : Rn → R and k : R → R, then using the fact that∇h(x) = [Dh(x)]T , we obtain

∇h(x) = k′(f(x))∇f(x).

19 / 30

Page 61: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient calculus

♠ Finding one subgradient within ∂f(x)

♠ Determining entire subdifferential ∂f(x) at a point x

♠ Do we have the chain rule?

♠ Usually not easy!

20 / 30

Page 62: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient calculus

♠ Finding one subgradient within ∂f(x)

♠ Determining entire subdifferential ∂f(x) at a point x

♠ Do we have the chain rule?

♠ Usually not easy!

20 / 30

Page 63: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient calculus

♠ Finding one subgradient within ∂f(x)

♠ Determining entire subdifferential ∂f(x) at a point x

♠ Do we have the chain rule?

♠ Usually not easy!

20 / 30

Page 64: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient calculus

♠ Finding one subgradient within ∂f(x)

♠ Determining entire subdifferential ∂f(x) at a point x

♠ Do we have the chain rule?

♠ Usually not easy!

20 / 30

Page 65: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient calculus∮If f is differentiable, ∂f(x) = {∇f(x)}

∮Scaling α > 0, ∂(αf)(x) = α∂f(x) = {αg | g ∈ ∂f(x)}∮Addition∗: ∂(f + k)(x) = ∂f(x) + ∂k(x) (set addition)∮Chain rule∗: Let A ∈ Rm×n, b ∈ Rm, f : Rm → R, andh : Rn → R be given by h(x) = f(Ax+ b). Then,

∂h(x) = AT∂f(Ax+ b).∮Chain rule∗: h(x) = f ◦ k, where k : X → Y is diff.

∂h(x) = ∂f(k(x)) ◦Dk(x) = [Dk(x)]T∂f(k(x))∮Max function∗: If f(x) := max1≤i≤m fi(x), then

∂f(x) = conv⋃{∂fi(x) | fi(x) = f(x)} ,

convex hull over subdifferentials of “active” functions at x∮Conjugation: z ∈ ∂f(x) if and only if x ∈ ∂f∗(z)

21 / 30

Page 66: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient calculus∮If f is differentiable, ∂f(x) = {∇f(x)}∮Scaling α > 0, ∂(αf)(x) = α∂f(x) = {αg | g ∈ ∂f(x)}

∮Addition∗: ∂(f + k)(x) = ∂f(x) + ∂k(x) (set addition)∮Chain rule∗: Let A ∈ Rm×n, b ∈ Rm, f : Rm → R, andh : Rn → R be given by h(x) = f(Ax+ b). Then,

∂h(x) = AT∂f(Ax+ b).∮Chain rule∗: h(x) = f ◦ k, where k : X → Y is diff.

∂h(x) = ∂f(k(x)) ◦Dk(x) = [Dk(x)]T∂f(k(x))∮Max function∗: If f(x) := max1≤i≤m fi(x), then

∂f(x) = conv⋃{∂fi(x) | fi(x) = f(x)} ,

convex hull over subdifferentials of “active” functions at x∮Conjugation: z ∈ ∂f(x) if and only if x ∈ ∂f∗(z)

21 / 30

Page 67: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient calculus∮If f is differentiable, ∂f(x) = {∇f(x)}∮Scaling α > 0, ∂(αf)(x) = α∂f(x) = {αg | g ∈ ∂f(x)}∮Addition∗: ∂(f + k)(x) = ∂f(x) + ∂k(x) (set addition)

∮Chain rule∗: Let A ∈ Rm×n, b ∈ Rm, f : Rm → R, andh : Rn → R be given by h(x) = f(Ax+ b). Then,

∂h(x) = AT∂f(Ax+ b).∮Chain rule∗: h(x) = f ◦ k, where k : X → Y is diff.

∂h(x) = ∂f(k(x)) ◦Dk(x) = [Dk(x)]T∂f(k(x))∮Max function∗: If f(x) := max1≤i≤m fi(x), then

∂f(x) = conv⋃{∂fi(x) | fi(x) = f(x)} ,

convex hull over subdifferentials of “active” functions at x∮Conjugation: z ∈ ∂f(x) if and only if x ∈ ∂f∗(z)

21 / 30

Page 68: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient calculus∮If f is differentiable, ∂f(x) = {∇f(x)}∮Scaling α > 0, ∂(αf)(x) = α∂f(x) = {αg | g ∈ ∂f(x)}∮Addition∗: ∂(f + k)(x) = ∂f(x) + ∂k(x) (set addition)∮Chain rule∗: Let A ∈ Rm×n, b ∈ Rm, f : Rm → R, andh : Rn → R be given by h(x) = f(Ax+ b). Then,

∂h(x) = AT∂f(Ax+ b).

∮Chain rule∗: h(x) = f ◦ k, where k : X → Y is diff.

∂h(x) = ∂f(k(x)) ◦Dk(x) = [Dk(x)]T∂f(k(x))∮Max function∗: If f(x) := max1≤i≤m fi(x), then

∂f(x) = conv⋃{∂fi(x) | fi(x) = f(x)} ,

convex hull over subdifferentials of “active” functions at x∮Conjugation: z ∈ ∂f(x) if and only if x ∈ ∂f∗(z)

21 / 30

Page 69: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient calculus∮If f is differentiable, ∂f(x) = {∇f(x)}∮Scaling α > 0, ∂(αf)(x) = α∂f(x) = {αg | g ∈ ∂f(x)}∮Addition∗: ∂(f + k)(x) = ∂f(x) + ∂k(x) (set addition)∮Chain rule∗: Let A ∈ Rm×n, b ∈ Rm, f : Rm → R, andh : Rn → R be given by h(x) = f(Ax+ b). Then,

∂h(x) = AT∂f(Ax+ b).∮Chain rule∗: h(x) = f ◦ k, where k : X → Y is diff.

∂h(x) = ∂f(k(x)) ◦Dk(x) = [Dk(x)]T∂f(k(x))

∮Max function∗: If f(x) := max1≤i≤m fi(x), then

∂f(x) = conv⋃{∂fi(x) | fi(x) = f(x)} ,

convex hull over subdifferentials of “active” functions at x∮Conjugation: z ∈ ∂f(x) if and only if x ∈ ∂f∗(z)

21 / 30

Page 70: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient calculus∮If f is differentiable, ∂f(x) = {∇f(x)}∮Scaling α > 0, ∂(αf)(x) = α∂f(x) = {αg | g ∈ ∂f(x)}∮Addition∗: ∂(f + k)(x) = ∂f(x) + ∂k(x) (set addition)∮Chain rule∗: Let A ∈ Rm×n, b ∈ Rm, f : Rm → R, andh : Rn → R be given by h(x) = f(Ax+ b). Then,

∂h(x) = AT∂f(Ax+ b).∮Chain rule∗: h(x) = f ◦ k, where k : X → Y is diff.

∂h(x) = ∂f(k(x)) ◦Dk(x) = [Dk(x)]T∂f(k(x))∮Max function∗: If f(x) := max1≤i≤m fi(x), then

∂f(x) = conv⋃{∂fi(x) | fi(x) = f(x)} ,

convex hull over subdifferentials of “active” functions at x

∮Conjugation: z ∈ ∂f(x) if and only if x ∈ ∂f∗(z)

21 / 30

Page 71: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient calculus∮If f is differentiable, ∂f(x) = {∇f(x)}∮Scaling α > 0, ∂(αf)(x) = α∂f(x) = {αg | g ∈ ∂f(x)}∮Addition∗: ∂(f + k)(x) = ∂f(x) + ∂k(x) (set addition)∮Chain rule∗: Let A ∈ Rm×n, b ∈ Rm, f : Rm → R, andh : Rn → R be given by h(x) = f(Ax+ b). Then,

∂h(x) = AT∂f(Ax+ b).∮Chain rule∗: h(x) = f ◦ k, where k : X → Y is diff.

∂h(x) = ∂f(k(x)) ◦Dk(x) = [Dk(x)]T∂f(k(x))∮Max function∗: If f(x) := max1≤i≤m fi(x), then

∂f(x) = conv⋃{∂fi(x) | fi(x) = f(x)} ,

convex hull over subdifferentials of “active” functions at x∮Conjugation: z ∈ ∂f(x) if and only if x ∈ ∂f∗(z)

21 / 30

Page 72: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Examples

It can happen that ∂(f1 + f2) 6= ∂f1 + ∂f2

Example Define f1 and f2 by

f1(x) :=

{−2√x if x ≥ 0,

+∞ if x < 0,and f2(x) :=

{+∞ if x > 0,

−2√−x if x ≤ 0.

Then, f = max {f1, f2} = I0, whereby ∂f(0) = RBut ∂f1(0) = ∂f2(0) = ∅.

However, ∂f1(x) + ∂f2(x) ⊂ ∂(f1 + f2)(x) always holds.

22 / 30

Page 73: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Examples

It can happen that ∂(f1 + f2) 6= ∂f1 + ∂f2

Example Define f1 and f2 by

f1(x) :=

{−2√x if x ≥ 0,

+∞ if x < 0,and f2(x) :=

{+∞ if x > 0,

−2√−x if x ≤ 0.

Then, f = max {f1, f2} = I0, whereby ∂f(0) = RBut ∂f1(0) = ∂f2(0) = ∅.

However, ∂f1(x) + ∂f2(x) ⊂ ∂(f1 + f2)(x) always holds.

22 / 30

Page 74: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Examples

It can happen that ∂(f1 + f2) 6= ∂f1 + ∂f2

Example Define f1 and f2 by

f1(x) :=

{−2√x if x ≥ 0,

+∞ if x < 0,and f2(x) :=

{+∞ if x > 0,

−2√−x if x ≤ 0.

Then, f = max {f1, f2} = I0, whereby ∂f(0) = RBut ∂f1(0) = ∂f2(0) = ∅.

However, ∂f1(x) + ∂f2(x) ⊂ ∂(f1 + f2)(x) always holds.

22 / 30

Page 75: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Examples

Example f(x) = ‖x‖∞. Then,

∂f(0) = conv {±e1, . . . ,±en} ,

where ei is i-th canonical basis vector (column of identity matrix).

To prove, notice that f(x) = max1≤i≤n{|eTi x|

}.

23 / 30

Page 76: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Examples

Example f(x) = ‖x‖∞. Then,

∂f(0) = conv {±e1, . . . ,±en} ,

where ei is i-th canonical basis vector (column of identity matrix).

To prove, notice that f(x) = max1≤i≤n{|eTi x|

}.

23 / 30

Page 77: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Example (S. Boyd)

Example Let f(x) = max{sTx | si ∈ {−1, 1}

}(2n members)

(−1, 1)

(1,−1)

∂f at x = (0, 0)

−1

+1

1

∂f at x = (1, 0)

−1

+1(1, 1)

∂f at x = (1, 1)

24 / 30

Page 78: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Example (S. Boyd)

Example Let f(x) = max{sTx | si ∈ {−1, 1}

}(2n members)

(−1, 1)

(1,−1)

∂f at x = (0, 0)

−1

+1

1

∂f at x = (1, 0)

−1

+1(1, 1)

∂f at x = (1, 1)

24 / 30

Page 79: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Example (S. Boyd)

Example Let f(x) = max{sTx | si ∈ {−1, 1}

}(2n members)

(−1, 1)

(1,−1)

∂f at x = (0, 0)

−1

+1

1

∂f at x = (1, 0)

−1

+1(1, 1)

∂f at x = (1, 1)

24 / 30

Page 80: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Example (S. Boyd)

Example Let f(x) = max{sTx | si ∈ {−1, 1}

}(2n members)

(−1, 1)

(1,−1)

∂f at x = (0, 0)

−1

+1

1

∂f at x = (1, 0)

−1

+1(1, 1)

∂f at x = (1, 1)

24 / 30

Page 81: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Rules for subgradients

25 / 30

Page 82: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient for pointwise sup

f(x) := supy∈Y

h(x, y)

Getting ∂f(x) is complicated!

Simple way to obtain some g ∈ ∂f(x):I Pick any y∗ for which h(x, y∗) = f(x)

I Pick any subgradient g ∈ ∂h(x, y∗)I This g ∈ ∂f(x)

h(z, y∗) ≥ h(x, y∗) + gT (z − x)h(z, y∗) ≥ f(x) + gT (z − x)

f(z) ≥ h(z, y) (because of sup)

f(z) ≥ f(x) + gT (z − x).

26 / 30

Page 83: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient for pointwise sup

f(x) := supy∈Y

h(x, y)

Getting ∂f(x) is complicated!

Simple way to obtain some g ∈ ∂f(x):

I Pick any y∗ for which h(x, y∗) = f(x)

I Pick any subgradient g ∈ ∂h(x, y∗)I This g ∈ ∂f(x)

h(z, y∗) ≥ h(x, y∗) + gT (z − x)h(z, y∗) ≥ f(x) + gT (z − x)

f(z) ≥ h(z, y) (because of sup)

f(z) ≥ f(x) + gT (z − x).

26 / 30

Page 84: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient for pointwise sup

f(x) := supy∈Y

h(x, y)

Getting ∂f(x) is complicated!

Simple way to obtain some g ∈ ∂f(x):I Pick any y∗ for which h(x, y∗) = f(x)

I Pick any subgradient g ∈ ∂h(x, y∗)I This g ∈ ∂f(x)

h(z, y∗) ≥ h(x, y∗) + gT (z − x)h(z, y∗) ≥ f(x) + gT (z − x)

f(z) ≥ h(z, y) (because of sup)

f(z) ≥ f(x) + gT (z − x).

26 / 30

Page 85: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient for pointwise sup

f(x) := supy∈Y

h(x, y)

Getting ∂f(x) is complicated!

Simple way to obtain some g ∈ ∂f(x):I Pick any y∗ for which h(x, y∗) = f(x)

I Pick any subgradient g ∈ ∂h(x, y∗)

I This g ∈ ∂f(x)

h(z, y∗) ≥ h(x, y∗) + gT (z − x)h(z, y∗) ≥ f(x) + gT (z − x)

f(z) ≥ h(z, y) (because of sup)

f(z) ≥ f(x) + gT (z − x).

26 / 30

Page 86: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient for pointwise sup

f(x) := supy∈Y

h(x, y)

Getting ∂f(x) is complicated!

Simple way to obtain some g ∈ ∂f(x):I Pick any y∗ for which h(x, y∗) = f(x)

I Pick any subgradient g ∈ ∂h(x, y∗)I This g ∈ ∂f(x)

h(z, y∗) ≥ h(x, y∗) + gT (z − x)h(z, y∗) ≥ f(x) + gT (z − x)

f(z) ≥ h(z, y) (because of sup)

f(z) ≥ f(x) + gT (z − x).

26 / 30

Page 87: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient for pointwise sup

f(x) := supy∈Y

h(x, y)

Getting ∂f(x) is complicated!

Simple way to obtain some g ∈ ∂f(x):I Pick any y∗ for which h(x, y∗) = f(x)

I Pick any subgradient g ∈ ∂h(x, y∗)I This g ∈ ∂f(x)

h(z, y∗) ≥ h(x, y∗) + gT (z − x)h(z, y∗) ≥ f(x) + gT (z − x)

f(z) ≥ h(z, y) (because of sup)

f(z) ≥ f(x) + gT (z − x).

26 / 30

Page 88: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient for pointwise sup

f(x) := supy∈Y

h(x, y)

Getting ∂f(x) is complicated!

Simple way to obtain some g ∈ ∂f(x):I Pick any y∗ for which h(x, y∗) = f(x)

I Pick any subgradient g ∈ ∂h(x, y∗)I This g ∈ ∂f(x)

h(z, y∗) ≥ h(x, y∗) + gT (z − x)h(z, y∗) ≥ f(x) + gT (z − x)

f(z) ≥ h(z, y) (because of sup)

f(z) ≥ f(x) + gT (z − x).

26 / 30

Page 89: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Example

Suppose ai ∈ Rn and bi ∈ R. And

f(x) := max1≤i≤n

(aTi x+ bi).

This f a max (in fact, over a finite number of terms)

I Suppose f(x) = aTk x+ bk for some index k

I Here f(x; y) = fk(x) = aTk x+ bk, and ∂fk(x) = {∇fk(x)}I Hence, ak ∈ ∂f(x) works!

27 / 30

Page 90: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Example

Suppose ai ∈ Rn and bi ∈ R. And

f(x) := max1≤i≤n

(aTi x+ bi).

This f a max (in fact, over a finite number of terms)

I Suppose f(x) = aTk x+ bk for some index k

I Here f(x; y) = fk(x) = aTk x+ bk, and ∂fk(x) = {∇fk(x)}I Hence, ak ∈ ∂f(x) works!

27 / 30

Page 91: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Example

Suppose ai ∈ Rn and bi ∈ R. And

f(x) := max1≤i≤n

(aTi x+ bi).

This f a max (in fact, over a finite number of terms)

I Suppose f(x) = aTk x+ bk for some index k

I Here f(x; y) = fk(x) = aTk x+ bk, and ∂fk(x) = {∇fk(x)}

I Hence, ak ∈ ∂f(x) works!

27 / 30

Page 92: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Example

Suppose ai ∈ Rn and bi ∈ R. And

f(x) := max1≤i≤n

(aTi x+ bi).

This f a max (in fact, over a finite number of terms)

I Suppose f(x) = aTk x+ bk for some index k

I Here f(x; y) = fk(x) = aTk x+ bk, and ∂fk(x) = {∇fk(x)}I Hence, ak ∈ ∂f(x) works!

27 / 30

Page 93: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient of expectation

Suppose f = Ef(x, u), where f is convex in x for each u (an r.v.)

f(x) :=

∫f(x, u)p(u)du

I For each u choose any g(x, u) ∈ ∂xf(x, u)I Then, g =

∫g(x, u)p(u)du = Eg(x, u) ∈ ∂f(x)

28 / 30

Page 94: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient of expectation

Suppose f = Ef(x, u), where f is convex in x for each u (an r.v.)

f(x) :=

∫f(x, u)p(u)du

I For each u choose any g(x, u) ∈ ∂xf(x, u)

I Then, g =∫g(x, u)p(u)du = Eg(x, u) ∈ ∂f(x)

28 / 30

Page 95: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient of expectation

Suppose f = Ef(x, u), where f is convex in x for each u (an r.v.)

f(x) :=

∫f(x, u)p(u)du

I For each u choose any g(x, u) ∈ ∂xf(x, u)I Then, g =

∫g(x, u)p(u)du = Eg(x, u) ∈ ∂f(x)

28 / 30

Page 96: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient of composition

Suppose h : Rn → R cvx and nondecreasing; each fi cvx

f(x) := h(f1(x), f2(x), . . . , fn(x)).

To find a vector g ∈ ∂f(x), we may:

I For i = 1 to n, compute gi ∈ ∂fi(x)I Compute u ∈ ∂h(f1(x), . . . , fn(x))I Set g = u1g1 + u2g2 + · · ·+ ungn; this g ∈ ∂f(x)I Compare with ∇f(x) = J∇h(x), where J matrix of ∇fi(x)

Exercise: Verify g ∈ ∂f(x) by showing f(z) ≥ f(x) + gT (z − x)

29 / 30

Page 97: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient of composition

Suppose h : Rn → R cvx and nondecreasing; each fi cvx

f(x) := h(f1(x), f2(x), . . . , fn(x)).

To find a vector g ∈ ∂f(x), we may:

I For i = 1 to n, compute gi ∈ ∂fi(x)I Compute u ∈ ∂h(f1(x), . . . , fn(x))I Set g = u1g1 + u2g2 + · · ·+ ungn; this g ∈ ∂f(x)I Compare with ∇f(x) = J∇h(x), where J matrix of ∇fi(x)

Exercise: Verify g ∈ ∂f(x) by showing f(z) ≥ f(x) + gT (z − x)

29 / 30

Page 98: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient of composition

Suppose h : Rn → R cvx and nondecreasing; each fi cvx

f(x) := h(f1(x), f2(x), . . . , fn(x)).

To find a vector g ∈ ∂f(x), we may:

I For i = 1 to n, compute gi ∈ ∂fi(x)

I Compute u ∈ ∂h(f1(x), . . . , fn(x))I Set g = u1g1 + u2g2 + · · ·+ ungn; this g ∈ ∂f(x)I Compare with ∇f(x) = J∇h(x), where J matrix of ∇fi(x)

Exercise: Verify g ∈ ∂f(x) by showing f(z) ≥ f(x) + gT (z − x)

29 / 30

Page 99: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient of composition

Suppose h : Rn → R cvx and nondecreasing; each fi cvx

f(x) := h(f1(x), f2(x), . . . , fn(x)).

To find a vector g ∈ ∂f(x), we may:

I For i = 1 to n, compute gi ∈ ∂fi(x)I Compute u ∈ ∂h(f1(x), . . . , fn(x))

I Set g = u1g1 + u2g2 + · · ·+ ungn; this g ∈ ∂f(x)I Compare with ∇f(x) = J∇h(x), where J matrix of ∇fi(x)

Exercise: Verify g ∈ ∂f(x) by showing f(z) ≥ f(x) + gT (z − x)

29 / 30

Page 100: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient of composition

Suppose h : Rn → R cvx and nondecreasing; each fi cvx

f(x) := h(f1(x), f2(x), . . . , fn(x)).

To find a vector g ∈ ∂f(x), we may:

I For i = 1 to n, compute gi ∈ ∂fi(x)I Compute u ∈ ∂h(f1(x), . . . , fn(x))I Set g = u1g1 + u2g2 + · · ·+ ungn; this g ∈ ∂f(x)

I Compare with ∇f(x) = J∇h(x), where J matrix of ∇fi(x)

Exercise: Verify g ∈ ∂f(x) by showing f(z) ≥ f(x) + gT (z − x)

29 / 30

Page 101: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient of composition

Suppose h : Rn → R cvx and nondecreasing; each fi cvx

f(x) := h(f1(x), f2(x), . . . , fn(x)).

To find a vector g ∈ ∂f(x), we may:

I For i = 1 to n, compute gi ∈ ∂fi(x)I Compute u ∈ ∂h(f1(x), . . . , fn(x))I Set g = u1g1 + u2g2 + · · ·+ ungn; this g ∈ ∂f(x)I Compare with ∇f(x) = J∇h(x), where J matrix of ∇fi(x)

Exercise: Verify g ∈ ∂f(x) by showing f(z) ≥ f(x) + gT (z − x)

29 / 30

Page 102: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

Subgradient of composition

Suppose h : Rn → R cvx and nondecreasing; each fi cvx

f(x) := h(f1(x), f2(x), . . . , fn(x)).

To find a vector g ∈ ∂f(x), we may:

I For i = 1 to n, compute gi ∈ ∂fi(x)I Compute u ∈ ∂h(f1(x), . . . , fn(x))I Set g = u1g1 + u2g2 + · · ·+ ungn; this g ∈ ∂f(x)I Compare with ∇f(x) = J∇h(x), where J matrix of ∇fi(x)

Exercise: Verify g ∈ ∂f(x) by showing f(z) ≥ f(x) + gT (z − x)

29 / 30

Page 103: Convex Optimization - Suvritsuvrit.de/teach/ee227a/lect4.pdfConvex Optimization (EE227A: UC Berkeley)Lecture 4 (Conjugates, subdi erentials) 31 Jan, 2013 Suvrit Sra

References

1 R. T. Rockafellar. Convex Analysis

2 S. Boyd (Stanford); EE364b Lecture Notes.

30 / 30