


\begin{frame}
	\begin{block}{So our task is cut out now}
		\begin{itemize}
			\item<1-> Define what our Markov Chain is? \onslide<2->{\alert{\textbf{(done)}}}
			\item<1-> Define the transition matrix $T$ for our Markov Chain \onslide<3->{\alert{\textbf{(done)}}}
			\item<1-> Show how it is easy to sample from this chain \onslide<4->{\alert{\textbf{(done)}}}
			\item<1-> Show that the stationary distribution of this chain is the distribution $P(X)$ (\textit{i.e.}, the distribution that we care about) \onslide<5->{\alert{\textbf{(done)}}}
			\item<1-> Show that the chain is irreducible and aperiodic \onslide<6->{\textbf{(let us see)}}
		\end{itemize}
	\end{block}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
	\begin{columns}

		\begin{column}{0.4\textwidth}
			\renewcommand{\arraystretch}{1.5}
			\begin{table}[]
				\centering
				\scalebox{0.65}
				{
					\begin{tabular}{l c c c c c c c c}

              & $V_1$ & $V_2$ & $ \dots$ & $V_m$  & $H_1$ & $H_2$ & $ \dots$ & $H_n$\\
				 & $X_1$ & $X_2$ & $X_3$ &   & $\dots$ & $\dots$ &  & $X_{n+m}$ \\
						0 & 1 & \alert<1->{1} & 0 &   & $\dots$ & $\dots$ &  & 1 \\
						1 & 1 & \textcolor{blue}{0} & \alert<1->{0} &   & $\dots$ & $\dots$ &  & 1 \\
						2 & \alert<1->{1} & 0 & \textcolor{blue}{1} &   & $\dots$ & $\dots$ &  & 1 \\
						3 & \textcolor{blue}{1} & 0 & 1 &   & $\dots$ & $\dots$ &  & \alert<1->{1} \\
						4 & 1 & 0 & 1 &   & $\dots$ & $\dots$ &  & \textcolor{blue}{0}\\
						$\vdots$ & $\vdots$  &  &  &   &  &  &  & \\
						$\vdots$ & $\vdots$ &  &  &   &  &  &  & \\
					\end{tabular}
				}

			\end{table}
		\end{column}
		\begin{column}{0.6\textwidth}

			\begin{itemize}
				\justifying
				\item<1-> A Markov chain is irreducible if one can get from any state in $\Omega$ to any other in a finite number of transitions or more formally
				\begin{align*}
				    \forall i, j \in \Omega ~~ \exists k > 0 ~~ \text{with}\\
				    P(X^{(k)} = j | X^{(0)} = i) > 0
				\end{align*}
				\item<2-> Intuitively, we can see that our chain is irreducible
				\item<3-> For example, notice that we can reach from the state containing all 0's to all 1's after some finite time steps
				\item<4-> We can prove this more formally but for now we will just rely on the intuition
			\end{itemize}
		\end{column}
	\end{columns}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
	\begin{columns}

		\begin{column}{0.4\textwidth}
			\renewcommand{\arraystretch}{1.5}
			\begin{table}[]
				\centering
				\scalebox{0.65}
				{
					\begin{tabular}{l c c c c c c c c}

              & $V_1$ & $V_2$ & $ \dots$ & $V_m$  & $H_1$ & $H_2$ & $ \dots$ & $H_n$\\
				 & $X_1$ & $X_2$ & $X_3$ &   & $\dots$ & $\dots$ &  & $X_{n+m}$ \\
						0 & 1 & \alert<1->{1} & 0 &   & $\dots$ & $\dots$ &  & 1 \\
						1 & 1 & \textcolor{blue}{0} & \alert<1->{0} &   & $\dots$ & $\dots$ &  & 1 \\
						2 & \alert<1->{1} & 0 & \textcolor{blue}{1} &   & $\dots$ & $\dots$ &  & 1 \\
						3 & \textcolor{blue}{1} & 0 & 1 &   & $\dots$ & $\dots$ &  & \alert<1->{1} \\
						4 & 1 & 0 & 1 &   & $\dots$ & $\dots$ &  & \textcolor{blue}{0}\\
						$\vdots$ & $\vdots$  &  &  &   &  &  &  & \\
						$\vdots$ & $\vdots$ &  &  &   &  &  &  & \\
					\end{tabular}
				}

			\end{table}
		\end{column}
		\begin{column}{0.6\textwidth}

			\begin{itemize}
				\justifying
				\item<1-> A chain is called aperiodic if $\forall i \in \Omega$ the greatest common divisor of \\
				    $\{ k|P(X^{(k)} = i | X^{(0)} = i) > 0 ~~ \wedge ~ k \in N_0 \}~$is 1
				\item<2-> The set we have defined above contains all the timesteps at which we can reach state $i$ starting from step $i$
				\item<3-> Suppose the chain was periodic then this set would contain multiples of a certain number
				\item<4-> For example, $\{3, 6, 9, 12, \dots \}$ and hence the greater common divisor would be 3 (and the Markov Chain would be periodic with a period of 3)
				\item<5-> However if the chain is not periodic then the set would contain arbitrary numbers and their GCD would just be 1 (hence the above definition)
			\end{itemize}
		\end{column}
	\end{columns}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
	\begin{columns}

		\begin{column}{0.4\textwidth}
			\renewcommand{\arraystretch}{1.5}
			\begin{table}[]
				\centering
				\scalebox{0.65}
				{
					\begin{tabular}{l c c c c c c c c}

              & $V_1$ & $V_2$ & $ \dots$ & $V_m$  & $H_1$ & $H_2$ & $ \dots$ & $H_n$\\
				 & $X_1$ & $X_2$ & $X_3$ &   & $\dots$ & $\dots$ &  & $X_{n+m}$ \\
						0 & 1 & \alert<1->{1} & 0 &   & $\dots$ & $\dots$ &  & 1 \\
						1 & 1 & \textcolor{blue}{0} & \alert<1->{0} &   & $\dots$ & $\dots$ &  & 1 \\
						2 & \alert<1->{1} & 0 & \textcolor{blue}{1} &   & $\dots$ & $\dots$ &  & 1 \\
						3 & \textcolor{blue}{1} & 0 & 1 &   & $\dots$ & $\dots$ &  & \alert<1->{1} \\
						4 & 1 & 0 & 1 &   & $\dots$ & $\dots$ &  & \textcolor{blue}{0}\\
						$\vdots$ & $\vdots$  &  &  &   &  &  &  & \\
						$\vdots$ & $\vdots$ &  &  &   &  &  &  & \\
					\end{tabular}
				}

			\end{table}
		\end{column}
		\begin{column}{0.6\textwidth}

			\begin{itemize}
				\justifying
				\item<1-> Again intuitively it should be clear that our chain is aperiodic
				\item<2-> Once again, we can formally prove this but we will just rely on the intuition for now
			\end{itemize}
		\end{column}
	\end{columns}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
	\begin{block}{So our task is cut out now}
		\begin{itemize}
			\item<1-> Define what our Markov Chain is? \alert{\textbf{(done)}}
			\item<1-> Define the transition matrix $T$ for our Markov Chain \alert{\textbf{(done)}}
			\item<1-> Show how it is easy to sample from this chain \alert{\textbf{(done)}}
			\item<1-> Show that the stationary distribution of this chain is the distribution $P(X)$ (\textit{i.e.}, the distribution that we care about) \alert{\textbf{(done)}}
			\item<1-> Show that the chain is irreducible and aperiodic \onslide<2->{\alert{\textbf{(done)}}}
		\end{itemize}
	\end{block}
\end{frame}

\begin{frame}
	\myheading{Module 20.4 : Training RBMs using Gibbs Sampling }
\end{frame}

\begin{frame}
	\begin{itemize}
		\justifying
		\item<1-> Okay, so we are now ready to write the full algorithm for training RBMs using Gibbs Sampling
		\item<2-> We will first quickly revisit the expectations that we wanted to compute and write a simplified expression for them
	\end{itemize}
\end{frame}

\begin{frame}
	\begin{columns}
		\column{0.4\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
            \input{modules/Module2/tikz_images/rbm}
			 $E(V,H) = -\sum_i\sum_j w_{ij} v_i h_j  -\sum_i b_i v_i -\sum_j c_j h_j$
		\end{overlayarea}
		\column{0.6\textwidth}
		\begin{overlayarea}{\textwidth}{\textheight}
			\begin{align*}
				&\frac{\partial \mathscr{L}(\theta)}{\partial w_{ij}} \\
				\onslide<2->{&= -\sum_H p(H|V) \frac{\partial E(V,H)}{\partial w_{ij}} + \sum_{V,H} p(V,H) \frac{\partial E(V,H)}{\partial w_{ij}}\\}
				\onslide<3->{&= \sum_H p(H|V) h_i v_j - \sum_{V,H} p(V,H) h_i v_j\\}
				\onslide<5->{&= \mathbb{E}_{p(H|V)} [v_i h_j] - \mathbb{E}_{p(V,H)} [v_i h_j]}
				% \onslide<4->{&= \sum_H p(H|V) h_i v_j - \sum_{V} p(V) \sum_{H} p(H|V) h_i v_j}
			\end{align*}
			\vspace{-0.5cm}
			\begin{itemize}\justifying
			    \item<4-> We were interested in computing the partial derivative of the log likehood w.r.t. one of the parameters ($w_{ij}$)
			    \item<5-> We saw that this partial derivative is actually the sum of two expectations
			    \item<6-> We will now simplify the expression for these two expectations
			\end{itemize}
		\end{overlayarea}
	\end{columns}
\end{frame}

\begin{frame}
	\begin{columns}

		\begin{column}{0.0\textwidth}
			\begin{overlayarea}{\textwidth}{\textheight}
				\centering
				\vspace{3.5cm}
				% \textbf{To prove Detailed Balance Condition}

			\end{overlayarea}
		\end{column}
		\begin{column}{1.0\textwidth}
			\scriptsize{\begin{align*}
				\frac{\partial \mathscr{L}(\theta)}{\partial w_{ij}} &= \mathbb{E}_{p(H|V)}[v_j h_i] - \mathbb{E}_{p(V,H)} [v_j h_i] \\
				\onslide<2->{&= \sum_{\bm{h}}p(\bm{h}|\bm{v})h_{i}v_{j} - \sum_{\bm{v},\bm{h}}p(\bm{v},\bm{h})h_{i}v_{j} } \\
				\onslide<3->{&= \sum_{\bm{h}}p(\bm{h}|\bm{v})h_{i}v_{j} - \sum_{\bm{v}}p(\bm{v})\sum_{\bm{h}}p(\bm{h}|\bm{v})h_{i}v_{j} } \\
				\onslide<4->{\text{We will first focus on $\sum_h p(h|v)h_iv_j$}} \\
				\onslide<5->{\sum_{\bm{h}}p(\bm{h}|\bm{v})h_{i}v_{j} &= \sum_{h_{i}}\sum_{\bm{h}_{-i}} p(h_{i}|\bm{v})p(\bm{\bm{h}_{-i}}|\bm{v})h_{i}v_{j}} \\
				\onslide<6->{ &= \sum_{h_{i}}p(h_{i}|\bm{v})h_{i}v_{j}\sum_{\bm{h}_{-i}}p(\bm{h}_{-i}|\bm{v})} \\
				\onslide<7->{ &= p(H_{i} = 1|\bm{v})v_{j}} \\
				\onslide<8->{ &= \sigma(\sum_{j=1}^{m}w_{ij}v_{j} + c_{i})v_{j}} \\
				\onslide<9->{\frac{\partial \mathscr{L}(\theta)}{\partial w_{ij}} &= \sigma(\sum_{j=1}^{m}w_{ij}v_{j} + c_{i})v_{j} - \sum_{\bm{v}}p(\bm{v})\sigma(\sum_{j=1}^{m}w_{ij}v_{j} + c_{i})v_{j}}
			\end{align*}}
		\end{column}
	\end{columns}
\end{frame}

\begin{frame}
	\input{modules/Module2/tikz_images/rbm1.tex}
	\begin{align*}
		\onslide<1->{\frac{\partial \mathscr{L}(\theta)}{\partial w_{ij}} &= \sigma(\sum_{j=1}^{m}w_{ij}v_{j} + c_{i})v_{j} - \sum_{\bm{v}}p(\bm{v})\sigma(\sum_{j=1}^{m}w_{ij}v_{j} + c_{i})v_{j}} \\
		\onslide<2->{ &= \sigma(\bm{w}_{i}\bm{v} + c_{i})v_{j}-\sum_{\bm{v}}p(\bm{v})\sigma(\bm{w}_{i}\bm{v} + c_{i})v_{j}} \\
		\onslide<3->{\nabla_{\mathbf{W}}\mathscr{L(\theta)} &= \sigma(\mathbf{W}\bm{v}+\bm{c})\bm{v}^{T} - \sum_{\bm{v}}p(\bm{v})\sigma(\mathbf{W}\bm{v}+\bm{c})\bm{v}^{T}} \\
		%\onslide<4->{&=\bm{h}\bm{v}^{T} - \mathbb{E}_{\mathbf{v}}[\bm{h}\bm{v}^{T}] ~~~~~~~\because \sigma(\mathbf{W}\bm{v}+\bm{c}) = \bm{h}}
		\onslide<4->{&=\sigma(\mathbf{W}\bm{v}+\bm{c})\bm{v}^{T} - \mathbb{E}_{\mathbf{v}}[\sigma(\mathbf{W}\bm{v}+\bm{c})\bm{v}^{T}]}
	\end{align*}
\end{frame}


\begin{frame}
	\begin{columns}
		\begin{column}{0.0\textwidth}
				\centering
			% \begin{align*}
			% 	\frac{\partial \mathscr{L}(\theta)}{\partial b_{j}} &= \mathbb{E}_{p(H|V)}[v_j] - \mathbb{E}_{p(V,H)} [v_j] \\
			% 	\onslide<2->{ &= \sum_{\bm{h}}p(\bm{h}|\bm{v})v_{j} - \sum_{\bm{v},\bm{h}}p(\bm{v},\bm{h})v_{j} } \\
			% 	\onslide<3->{ &= \sum_{\bm{h}}p(\bm{h}|\bm{v})v_{j} - \sum_{\bm{v}}p(\bm{v})\sum_{\bm{h}}p(\bm{h}|\bm{v})v_{j}} \\
			% 	\onslide<4->{ &= v_{j}\sum_{\bm{h}}p(\bm{h}|\bm{v}) - \sum_{\bm{v}}p(\bm{v})v_{j}\sum_{\bm{h}}p(\bm{h}|\bm{v})} \\
			% 	\onslide<5->{ &= v_{j} - \sum_{\bm{v}}p(\bm{v})v_{j}}
			% \end{align*}
		\end{column}
		\begin{column}{1.0\textwidth}
			\begin{align*}
				\frac{\partial \mathscr{L}(\theta)}{\partial b_{j}} &= \mathbb{E}_{p(H|V)}[v_j] - \mathbb{E}_{p(V,H)} [v_j] \\
				\onslide<2->{ &= \sum_{\bm{h}}p(\bm{h}|\bm{v})v_{j} - \sum_{\bm{v},\bm{h}}p(\bm{v},\bm{h})v_{j} } \\
				\onslide<3->{ &= \sum_{\bm{h}}p(\bm{h}|\bm{v})v_{j} - \sum_{\bm{v}}p(\bm{v})\sum_{\bm{h}}p(\bm{h}|\bm{v})v_{j}} \\
				\onslide<4->{ &= v_{j}\sum_{\bm{h}}p(\bm{h}|\bm{v}) - \sum_{\bm{v}}p(\bm{v})v_{j}\sum_{\bm{h}}p(\bm{h}|\bm{v})} \\
				\onslide<5->{ &= v_{j} - \sum_{\bm{v}}p(\bm{v})v_{j}} \\
				\onslide<6->{\nabla_{\bm{b}}\mathscr{L}(\theta) &= \bm{v} - \sum_{\bm{v}}p(\bm{v})\bm{v} } \\
				\onslide<7->{&= \bm{v} - \mathbb{E}_{\bm{v}}[\bm{v}]}
			\end{align*}
		\end{column}
	\end{columns}
\end{frame}

\begin{frame}
	\begin{columns}
		\begin{column}{0.0\textwidth}
				\centering
			% \begin{align*}
			% 	\frac{\partial \mathscr{L}(\theta)}{\partial b_{j}} &= \mathbb{E}_{p(H|V)}[v_j] - \mathbb{E}_{p(V,H)} [v_j] \\
			% 	\onslide<2->{ &= \sum_{\bm{h}}p(\bm{h}|\bm{v})v_{j} - \sum_{\bm{v},\bm{h}}p(\bm{v},\bm{h})v_{j} } \\
			% 	\onslide<3->{ &= \sum_{\bm{h}}p(\bm{h}|\bm{v})v_{j} - \sum_{\bm{v}}p(\bm{v})\sum_{\bm{h}}p(\bm{h}|\bm{v})v_{j}} \\
			% 	\onslide<4->{ &= v_{j}\sum_{\bm{h}}p(\bm{h}|\bm{v}) - \sum_{\bm{v}}p(\bm{v})v_{j}\sum_{\bm{h}}p(\bm{h}|\bm{v})} \\
			% 	\onslide<5->{ &= v_{j} - \sum_{\bm{v}}p(\bm{v})v_{j}}
			% \end{align*}
		\end{column}
		\begin{column}{1.0\textwidth}
			\begin{align*}
				\frac{\partial \mathscr{L}(\theta)}{\partial c_{i}} &= \mathbb{E}_{p(H|V)}[h_i] - \mathbb{E}_{p(V,H)} [h_i] \\
				\onslide<2->{&= \sum_{\bm{h}}p(\bm{h}|\bm{v})h_{i} - \sum_{\bm{v},\bm{h}}p(\bm{v},\bm{h})h_{i} } \\
				\onslide<3->{ &= \sum_{\bm{h}}p(\bm{h}|\bm{v})h_{i} - \sum_{\bm{v}}p(\bm{v})\sum_{\bm{h}}p(\bm{h}|\bm{v})h_{i}} \\
				\onslide<4->{ &= p(H_{i} = 1|\bm{v}) - \sum_{\bm{v}}p(\bm{v})p(H_{i} = 1|\bm{v})} \\
				\onslide<5->{ &= \sigma(\sum_{j=1}^{m}w_{ij}v_{j} + c_{i}) - \sum_{\bm{v}}p(\bm{v})\sigma(\sum_{j=1}^{m}w_{ij}v_{j} + c_{i})} \\
				\onslide<6->{\nabla_{\bm{c}}\mathscr{L}(\theta) &= \sigma(\mathbf{W}\bm{v} + \bm{c}) - \sum_{\bm{v}}p(\bm{v})\sigma(\mathbf{W}\bm{v} + \bm{c})} \\
				%\onslide<7->{&= \bm{h} - \mathbb{E}_{\bm{v}}[\bm{h}]}
				\onslide<7->{&= \sigma(\mathbf{W}\bm{v} + \bm{c}) - \mathbb{E}_{\bm{v}}[\sigma(\mathbf{W}\bm{v} + \bm{c})]}
			\end{align*}
		\end{column}
	\end{columns}
\end{frame}

\begin{frame}
	\begin{columns}
		\begin{column}{0.5\textwidth}
			\begin{align*}
				%\onslide<2->{\mathbb{E}_{\mathbf{v}}[\bm{h}\bm{v}^{T}] \onslide<7->{&\approx \frac{1}{k}\sum_{i=1}^{k}\bm{h}^{(k)}\bm{v}^{(k)T}}} \\
				\onslide<2->{\mathbb{E}_{\mathbf{v}}[\sigma(\mathbf{W}\bm{v} + \bm{c})\bm{v}^{T}] \onslide<7->{&\approx \frac{1}{k}\sum_{i=1}^{k}\sigma(\mathbf{W}\bm{v}^{(k)} + \bm{c})\bm{v}^{(k)T}}} \\
				%\onslide<3->{\mathbb{E}_{\bm{v}}[\bm{v}] \onslide<8->{&\approx \frac{1}{k}\sum_{i=1}^{k}\bm{v}^{(k)}}}\\
				\onslide<3->{\mathbb{E}_{\bm{v}}[\bm{v}] \onslide<8->{&\approx \frac{1}{k}\sum_{i=1}^{k}\bm{v}^{(k)}}}\\
				%\onslide<4->{\mathbb{E}_{\bm{v}}[\bm{h}] \onslide<9->{&\approx \frac{1}{k}\sum_{i=1}^{k}\bm{h}^{(k)}}}
				\onslide<4->{\mathbb{E}_{\bm{v}}[\sigma(\mathbf{W}\bm{v} + \bm{c})] \onslide<9->{&\approx \frac{1}{k}\sum_{i=1}^{k}\sigma(\mathbf{W}\bm{v}^{(k)} + \bm{c})}}
			\end{align*}
		\end{column}
		\begin{column}{0.5\textwidth}
			\begin{itemize}
				\item<1-> Notice that all the 3 gradient expressions have an expectation term
				\item<5-> These expectations are intractable.
				\item<6-> Solution? \onslide<7->{Estimation with the help of sampling}
				\item<8-> Specifically, we will use Gibbs Sampling to estimate the expectation
			\end{itemize}
		\end{column}
	\end{columns}
\end{frame}

\begin{frame}
	\small{
		\onslide<1->{\begin{algorithm}[H]
						\onslide<2->{\textbf{Input:}} \onslide<3->{RBM $(V_1, ... , V_m, H_1 ,..., H_n)$, training batch $D$}\\
						\onslide<4->{\textbf{Output:}} \onslide<5->{Learned Parameters $\mathbf{W}, \bm{b}, \bm{c}$} \\
						\onslide<6->{init $\mathbf{W}, \bm{b}, \bm{c}$} \\
						\onslide<7->{\ForAll{$\bm{v} \in D$}{
										\onslide<8->{Randomly initialize $\bm{v}^{(0)}$} \\
										\onslide<9->{\For{$t=0,...,k,k+1,...,k+r$}{
																		\onslide<10->{\For{$i=1,...,n$} {\onslide<11->{sample $h_{i}^{(t)} \sim\ p(h_{i}|\bm{v}^{(t)})$}}}
																		\onslide<12->{\For{$j=1,...,m$} {\onslide<13->{sample $v_{j}^{(t+1)} \sim\ p(v_{j}|\bm{h}^{(t)})$}} }
																	} }
										\onslide<14->{$\mathbf{W} \leftarrow \mathbf{W} + \eta\only<14>{\nabla_{\mathbf{W}}\mathscr{L}(\theta)}\onslide<15->{[\sigma(\mathbf{W}\bm{v}_{d} + \bm{c})\bm{v}_{d}^{T} - \frac{1}{r}\sum_{t=k+1}^{k+r}\sigma(\mathbf{W}\bm{v}^{(t)} + \bm{c})\bm{v}^{(t)T}]}$} \\
										%\onslide<14->{$\mathbf{W} \leftarrow \mathbf{W} + \nabla_{\mathbf{W}}\mathscr{L}(\theta) \leftarrow \onslide<15->{\sigma(\mathbf{W}\bm{v}_{d} + \bm{c})\bm{v}_{d}^{T} - \frac{1}{r}\sum_{t=k+1}^{k+r}\sigma(\mathbf{W}\bm{v}^{(t)} + \bm{c})\bm{v}^{(t)T}$}} \\
										\onslide<16->{$\bm{b} \leftarrow \bm{b} + \eta \only<16>{\nabla_{\bm{b}}\mathscr{L}(\theta)} \onslide<17->{[\bm{v}_{d} - \frac{1}{r}\sum_{t=k+1}^{k+r}\bm{v}^{(t)}]}$} \\
										%\onslide<16->{$\bm{b} \leftarrow \bm{b} + \nabla_{\bm{b}}\mathscr{L}(\theta) \leftarrow \onslide<17->{\bm{v}_{d} - \frac{1}{r}\sum_{t=k+1}^{k+r}\bm{v}^{(t)}}$} \\
										\onslide<18->{$\bm{c} \leftarrow \bm{c} + \eta \only<18>{\nabla_{\bm{c}}\mathscr{L}(\theta)}\onslide<19->{[\sigma(\mathbf{W}\bm{v}_{d} + \bm{c}) - \frac{1}{r}\sum_{t=k+1}^{k+r}\sigma(\mathbf{W}\bm{v}^{(t)} + \bm{c})]}$}
										%\onslide<18->{$\bm{c} \leftarrow \bm{c} + \nabla_{\bm{c}}\mathscr{L}(\theta) \leftarrow \onslide<19->{\sigma(\mathbf{W}\bm{v}_{d} + \bm{c}) - \frac{1}{r}\sum_{t=k+1}^{k+r}\sigma(\mathbf{W}\bm{v}^{(t)} + \bm{c})}$}
									}}
						\caption*{RBM Training with Block Gibbs Sampling}
					\end{algorithm}}
		}
\end{frame}
