Dynamic Programming Level Easy LeetCode0053 maximum-subarray int LeetCode0053::maxContiguousSubArraySum(vector<int>& nums) { /** * Find largest sum subarray, but just return it...
Variational Inference
Variational Inference In Bayesian Learning, when the involved integrations are no longer computationally tractable. Then Variational Approximation can be used. Although there is nothing intrinsi...
Expectation Maximization
Expectation Maximization EM Lower Bound analysis The expectation Maximization algorithm, or EM aoglrithm, is a general technique for finding maximum likelihood solutoins for probabilistic...
Bayesian Gaussian Mixture Model - Variational Inference
Bayesian Gaussian Mixture Model - Variational Inference Likelihood Funcitons [\begin{aligned} p(\mathbf{Z}\vert \boldsymbol{\pi}) &= \prod_{n=1}^N\prod_{k=1}^K \pi_k^{z_{nk}} \ \ p(\mathbf{X}...
Gaussian Processes
Gaussian Processes In the Gaussian process viewpoint, we dispense with the parametric model and instead define a prior probability distribution over functions directly. At first sight, it migh...
Gaussian Mixture Model
Gaussian Mixture Model Definite A simple linear superposition of multiple Gaussian would give a better characterization of multimodal data set. General Form of GMM [\begin{aligned} p(\boldsymbo...
Sampling Methods
Sampling Methods Ancestral Sampling Approach Directed Graph [\begin{aligned} p(\boldsymbol{z}) = \prod_{i}^M p(\boldsymbol{z} \vert pa_i) \end{aligned}] make one pass through the...
Markov Chain Monte Carlo
Markov Chain Monte Carlo As with rejection and importance sampling, we again sample from a proposal distribution. This time, however, we maintain a record of the current state $z(\...
Markov Chain
Markov Chain A first-Order Markov Chain [\begin{aligned} p(z^{(m+1)}\vert z^{(m)}, …,z^{(1)} ) = p(z^{(m+1)}\vert z^{(m)})\end{aligned}] then given initial variable: $p(z^{(0)})$ transitio...
Hidden Markov Model
Hidden Markov Model Assume that all latent variables form a Markov chain, giving rise to the graphical structure, this is known as a state space model. If the latent variables are discrete, then ...