Skip to content

Commit

Permalink
update ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiinchi committed Sep 10, 2019
1 parent 655689b commit febd275
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions seminars/day4/AdaGram/AdaGram seminar.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,19 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Answer**: $\\mathbb{E} K = $"
"**Solution**: \n",
"\n",
"We can express the number of tables $K$ as the number of times a new table has been created:\n",
"$$\n",
" K = \\sum_{i=1}^n \\mathbb{1}[ \\text{table created at } i].\n",
"$$\n",
"Then recall that expectation of an indicator is the probability of it to be true, hence\n",
"$$\n",
" \\mathbb{E} K = \\sum_{i=1}^n \\frac{\\alpha}{i - 1 + \\alpha}.\n",
"$$\n",
"This formula can be recognized as harmonic series, see https://en.wikipedia.org/wiki/Harmonic_number. \n",
"We can use this fact and after some calculations we get\n",
"$\\mathbb{E} K = \\alpha \\log(n) + \\text{const}$ when $n \\rightarrow \\infty$"
]
},
{
Expand Down Expand Up @@ -298,7 +310,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**Answer**: $q^*(\\beta_k) = $"
"**Solution**: The full solution can be found in the paper http://cs.columbia.edu/~blei/papers/BleiJordan2004.pdf, equation 18. In the paper's notation $\\beta_k$ is $V_k$."
]
},
{
Expand Down

0 comments on commit febd275

Please sign in to comment.