# Understanding a simple example of restricted Boltzmann machine (RBM)

I am trying to get an intuitive idea of RBMs out of curiosity, and using a simple example on youtube based on preferences for different sports, which denote profiles roughly corresponding to outdoor and indoor predilections. The idea is to target ads. Here is the model:

The examples in the sample are:

Example Football Hockey Cricket Table-tennis Chess Badminton      CLASS

P1          1       1       1         0        0      0           out
P2          1       0       0         1        1      1           in
P3          0       0       0         1        1      0           in
P4          1       1       0         0        0      0           out

The starting values are:

$W_i = 0.5 \quad A_i=0.2 \quad B_i=0.3.$

Given the first example,

$\begin{matrix}V_1 =V_2=V_3=1;\quad V_4=V_5=V_6=0 \end{matrix}$

Now the first step (updating hidden unit) with the first example $P1$:

$\begin{matrix}\text{Example}&\text{football}&\text{hockey}&\text{cricket}&\text{tt}&\text{chess}&\text{badm.}\\\text{P1}&\color{blue}1&\color{blue}1&\color{blue}1&\color{blue}0&\color{blue}0&\color{blue}0\end{matrix}$

is calculated (on the video) as follows:

\begin{align}\small\text{net}(H_1)&=(V_1H_1W_{11} + V_2H_1W_{12} + V3H_1W_{13} + V_4H_1W_{14} + V_5H_1W_{15} + V_6H_1W_{16})+B_1\\[2ex] &=\color{blue}1\times 1\times 0.5 +\color{blue}1\times 1\times 0.5 +\color{blue}1\times 1\times 0.5 +\underset{0 \text{ term} V \text{or} H \text{ not specified}}{\underbrace{0+0+0}}+0.3 \end{align}

and

\begin{align}\small\text{net}(H_2)&=(V_1H_2W_{21} + V_2H_2W_{22} + V3H_2W_{23} + V_4H_2W_{24} + V_5H_2W_{25} + V_6H_2W_{26})+B_2\\[2ex]&=\small \color{blue}0\times 1\times 0.5 +\color{blue}0\times 1\times 0.5 +\color{blue}0\times 1\times 0.5 +\color{blue}1\times 1 \times 0.5+\color{blue}1\times 1 \times 0.5+\color{blue}1\times 1 \times 0.5+0.3\end{align}

Here is the actual screen capture (slightly modified):

which seems to imply a change in the $V_i$ values for table-tennis, chess and badminton when transitioning from the update of $H_1$ to the update of $H_2$. Although I'm sure erroneously, I was expecting the following calculation, which would leave the $V_i$ values unchanged (blue for $V_i$). The red integers corresponding to $H_i$:

\begin{align}\small\text{net}(H_1)&=(V_1H_1W_{11} + V_2H_1W_{12} + V3H_1W_{13} + V_4H_1W_{14} + V_5H_1W_{15} + V_6H_1W_{16})+B_1\\[2ex] &=\small \color{blue} 1\times \color{red}1\times 0.5 +\color{blue}1\times \color{red}1\times 0.5 +\color{blue}1\times \color{red}1\times 0.5 +\color{blue}0\times \color{red}{0}\times 0.5 +\color{blue}0\times \color{red}{0}\times 0.5+\color{blue}0\times \color{red}{0}\times 0.5 +0.3\end{align}

\begin{align}\small\text{net}(H_2)&=(V_1H_2W_{21} + V_2H_2W_{22} + V3H_2W_{23} + V_4H_2W_{24} + V_5H_2W_{25} + V_6H_2W_{26})+B_2\\[2ex] &=\small \color{blue}1\times \color{red}0\times 0.5 +\color{blue}1\times \color{red}0\times 0.5 +\color{blue}1\times \color{red}0\times 0.5 +\color{blue}0\times \color{red}1\times 0.5 +\color{blue}0\times\color{red} 1\times 0.5+\color{blue}0\times\color{red} 1\times 0.5 +0.3\end{align}

Can I get an explanation as to how the example $P1$ is not ignored in the first updated of the hidden unit?

Evidently following the example would be much more self-explanatory if $P1$ wasn't such a pure outdoor case...

• the link seems broken – dontloo Jun 6 '17 at 9:29
• @dontloo I don't think it is broken. I think the video by Be Expert in Minutes was removed by the author. – Antoni Parellada Jun 6 '17 at 12:09
• yea, is it anywhere else to be found? – dontloo Jun 6 '17 at 12:37
• @dontloo I don't know. I had left a message to the author asking him about the issue I had problems understanding by pointing to my question here, and he never responded. It is possible that he decides to repost it at a later time. – Antoni Parellada Jun 6 '17 at 12:40
• good luck then. – dontloo Jun 6 '17 at 12:44