|
212 | 212 | "source": [
|
213 | 213 | "#### Convexity of KL-divergence\n",
|
214 | 214 | "Note that the KL divergence is convex in the space of pairs of probability distributions $(p,q)$, ie:\n",
|
215 |
| - "\\begin{align*}\n", |
216 |
| - " KL[\\lambda p_1 + (1-\\lambda) p_2 \\| \\lambda q_1 + (1-\\lambda) q_2] \\leq \\lambda KL[p_1\\|q_1] + (1-\\lambda) KL[p_2\\|q_2 \\tag{(2.1)}\n", |
| 215 | + "\\begin{align*}\\tag{2.1}\n", |
| 216 | + " KL[\\lambda p_1 + (1-\\lambda) p_2 \\| \\lambda q_1 + (1-\\lambda) q_2] \\leq \\lambda KL[p_1\\|q_1] + (1-\\lambda) KL[p_2\\|q_2]\n", |
217 | 217 | "\\end{align*}\n",
|
218 | 218 | "\n",
|
219 | 219 | "We recall that KL-divergence between two distribution $(p,q)$ reads\n",
|
|
248 | 248 | " &\\geq a log\\left(\\frac{a}{b}\\right) \\\\\n",
|
249 | 249 | "\\end{align*}\n",
|
250 | 250 | "\n",
|
251 |
| - "Now, using (2.4)\n", |
252 |
| - "\n" |
| 251 | + "You can notice that the last line of (2.4) is equivalent to the equation (2.3) we just have proved, we can now get back to our original problem, ie proving convexity of KL-divergence. Lets restart from (2.2):\n", |
| 252 | + "\n", |
| 253 | + "\\begin{align*}\n", |
| 254 | + " &KL[\\lambda p_1 + (1-\\lambda) p_2 \\| \\lambda q_1 + (1-\\lambda) q_2] \\\\\n", |
| 255 | + "&= - \\sum_{i=0}^{N-1} (\\lambda p_1(x_i) + (1-\\lambda) p_2(x_i))log\\left(\\frac{\\lambda p_1(x_i) + (1-\\lambda) p_2(x_i)}{\\lambda q_1(x_i) + (1-\\lambda) q_2(x_i)}\\right) \\\\\n", |
| 256 | + "&\\leq - \\sum_{i=0}^{N-1} \\lambda p_1(x_i)log\\left(\\frac{\\lambda p_1(x_i)}{\\lambda q_1(x_i)}\\right) + (1-\\lambda)p_2(x_i))log\\left(\\frac{(1-\\lambda) p_2(x_i)}{(1-\\lambda) q_2(x_i)}\\right) \\qquad \\text{thanks to (2.3)} \\\\\n", |
| 257 | + "&= \\lambda \\left[-\\sum_{i=0}^{N-1} p_1(x_i)log\\left(\\frac{p_1(x_i)}{q_1(x_i)}\\right) \\right] +(1-\\lambda) \\left[-\\sum_{i=0}^{N-1}p_2(x_i))log\\left(\\frac{ p_2(x_i)}{q_2(x_i)}\\right)\\right] \\\\\n", |
| 258 | + "&= \\lambda KL[p_1 \\| q_1] + (1-\\lambda)KL[p_2 \\| q_2]\n", |
| 259 | + "\\end{align*}\n", |
| 260 | + "\n", |
| 261 | + "KL-divergence is indeed convex in the space of pairs of distributions with matching support. Note that the support constraint is important, this will be reminded later on in the section dedicated to KL-divergennce." |
253 | 262 | ]
|
254 | 263 | },
|
255 | 264 | {
|
|
259 | 268 | "#### Using convexity of KL-divergence to prove entropy concavity\n",
|
260 | 269 | "\n",
|
261 | 270 | "Lets take a special case of equation (2.1) where $(q_1,q_2)=(u,u)$ a pair of uniform discrete distributions:\n",
|
262 |
| - "\\begin{align*} \\tag{(2.2)}\n", |
| 271 | + "\\begin{align*} \\tag{2.5}\n", |
263 | 272 | " KL[\\lambda p_1 + (1-\\lambda) p_2 \\| \\lambda u + (1-\\lambda) u] &\\leq \\lambda KL[p_1\\|u] + (1-\\lambda) KL[p_2\\|u] \\\\\n",
|
264 | 273 | " KL[\\lambda p_1 + (1-\\lambda) p_2 \\| u] &\\leq \\lambda KL[p_1\\|u] + (1-\\lambda) KL[p_2\\|u]\n",
|
265 | 274 | "\\end{align*}\n",
|
266 | 275 | "\n",
|
267 |
| - "Lets now replace $KL[p\\|u]$ from equation (2.2), ie $KL[p\\|u]=log(N)-H[p]$ with the expression obtained in (1.2):\n", |
| 276 | + "Lets now replace $KL[p\\|u]$ from equation (2.5) with the expression obtained in (1.2), ie $KL[p\\|u]=log(N)-H[p]$ :\n", |
268 | 277 | "\\begin{align*}\n",
|
269 | 278 | " KL[\\lambda p_1 + (1-\\lambda) p_2 \\| u] &\\leq \\lambda KL[p_1\\|u] + (1-\\lambda) KL[p_2\\|u] \\\\\n",
|
270 | 279 | " log(N)-H[\\lambda p_1 + (1-\\lambda) p_2] &\\leq \\lambda (log(N)-H[p_1]) + (1-\\lambda)(log(N)-H[p_2]) \\\\\n",
|
|
0 commit comments