Skip to content

[DOC] GSoC BayesianGaussianMixture formula #7284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

tguillemot
Copy link
Contributor

This PR adds the doc concerning the derivation formula of the BayesianGaussianMixture class.

I've done a separate PR because this is just formula and I thought it wil be easier to review if it was extracted on another PR.

Of course, this can't be merge before #6651.

@tguillemot tguillemot changed the title [MRG] GSoC BayesianGaussianMixture formulas [MRG] GSoC BayesianGaussianMixture formula Aug 29, 2016
@tguillemot tguillemot changed the title [MRG] GSoC BayesianGaussianMixture formula [DOC] GSoC BayesianGaussianMixture formula Aug 29, 2016
\end{eqnarray*}

References
----------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some references are missing here :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups indeed.


Notation
--------
Add notation of NK xk and Sk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

@tguillemot
Copy link
Contributor Author

tguillemot commented Aug 29, 2016

\bar{\mathbf{x}}_k & = & \frac{1}{N_k} \sum_{n=1}^N {r_{nk} \mathbf{x}_n}
\mathbf{S}_k & = & \frac{1}{N_k} \sum_{n=1}^N {r_{nk} (\mathbf{x}_n - \bar{\mathbf{x}}_k) (\mathbf{x}_n - \bar{\mathbf{x}}_k)^T}

\end{eqnarray*}
Copy link
Member

@ogrisel ogrisel Aug 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the following LaTeX rendering error:

Extra alignment tab has been changed to \cr. <template> \egroup \endtemplate l.15 \mathbf{S}_k & = & \frac{1}{N_k} \sum_{n=1}^N {r_{nk} (\mathbf{x}_n - ... ! Missing $ inserted. <inserted text> $ l.16 ! Missing } inserted. <inserted text> } l.16 ! Missing } inserted. <inserted text> } l.16 ! Missing \cr inserted. <inserted text> \cr l.16 ! Missing { inserted. <inserted text> { l.16 ! Missing $ inserted. <inserted text> $ l.16 ! Missing $$ inserted. <to be read again> \par l.16 !
LaTeX Error: Too many columns in eqnarray environment. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.17 \end{eqnarray*} ! Misplaced \cr. \@@eqncr ...l \@eqnswtrue \global \@eqcnt \z@ \cr l.17 \end{eqnarray*} ! Extra }, or forgotten \endgroup. \endeqnarray ->\@@eqncr \egroup \global \advance \c@equation \m@ne $$\@ignor... l.17 \end{eqnarray*} ! Missing $ inserted. <inserted text> $ l.17 \end{eqnarray*} ! Display math should end with $$. <to be read again> \endgroup l.17 \end{eqnarray*} [1] 

@tguillemot
Copy link
Contributor Author

New link

<http://www.springer.com/kr/book/9780387310732>`_,
Bishop, Christopher M. Springer, Vol. 4 No. 4, 2006.

While the book presents the parts of the variationnl inference algorithm, it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variationnl

@tguillemot tguillemot force-pushed the GSoC-BGM-formulas branch 3 times, most recently from e258117 to 426a6a2 Compare August 30, 2016 15:51
@ogrisel
Copy link
Member

ogrisel commented Sep 1, 2016

Please rebase this on top of master to make sure that the class link works as expected and add a link to the derivation page from the narrative documentation on variational Bayes mixture models.

Estimate Z
~~~~~~~~~~

Using the general result of variational inference, and take the expectation of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"taking". Also I don't think the comma is necessary before "and".

@tguillemot tguillemot force-pushed the GSoC-BGM-formulas branch 3 times, most recently from 6bf7b9a to b25523e Compare September 1, 2016 16:04
@tguillemot
Copy link
Contributor Author

Rebase done.
This is the new doc

@ogrisel
Copy link
Member

ogrisel commented Sep 8, 2016

C(\boldsymbol{\alpha}_0) is not defined. As alpha_0 is symmetric (same value for all the components, we should have:

C(\alpha_0) = \frac{\Gamma(\alpha_0){\Gamma(\alpha_0)^K}

I think.

@ogrisel
Copy link
Member

ogrisel commented Oct 10, 2016

Please update the link at the end of mixture.rst and remove dp-derivation.rst.

@ogrisel
Copy link
Member

ogrisel commented Oct 10, 2016

BTW, this PR need a rebase on top of the current master and also it should be stated that this derivation is valid only for the dirichlet distribution prior type (not the dirichlet process prior type).

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did another pass and found the following issues:

\end{eqnarray*}

Estimate lower bound terms
--------------------------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a subsection of the previous one which means using ~~~~~ instead of ----.

\end{eqnarray*}

Lower bound combination and simplifications
...........................................
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again this should be ~~~~.


Lower bound
...........
The lower bound :math:`\mathcal{L}` is defined by
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment as to why this is useful to estimate the lower bound:

This variational lower bound is guaranteed to be non-decreasing. It can therefore be computed to monitor the convergence of the model. It can also be used to catch implementation bugs if an update causes a decrease of this quantity.

.. toctree::
:hidden:

bayesian_gaussian_mixture_derivation.rst
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The derivation has a weird level of nesting for the headers. Maybe this is caused by inconsistencies in the underline style. They should be updated to use the same ordering for underline styles as in the mixture.rst file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed toctree:: :hidden:

Conflicts:
	examples/mixture/plot_bayesian_gaussian_mixture.py
@tguillemot tguillemot force-pushed the GSoC-BGM-formulas branch 4 times, most recently from fb9e809 to 672f448 Compare October 17, 2016 13:36
@tguillemot
Copy link
Contributor Author

Thanks @ogrisel

Copy link
Contributor

@cmarmo cmarmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tguillemot are you still interested in working on this? I know it has been a while, but if so, do you mind triggering a build as we can access the rendering of the documentation? Thanks a lot for your patience!

@@ -0,0 +1,636 @@
.. _bayesain_gaussian_mixture_derivation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. _bayesain_gaussian_mixture_derivation:
.. _bayesian_gaussian_mixture_derivation:

Base automatically changed from master to main January 22, 2021 10:49
@lorentzenchr
Copy link
Member

Seems very stalled and much too many formulae, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants