# Why is the restricted boltzmann machine both unsupervised and generative?

The restricted boltzmann machine is a generative learning model - but it is also unsupervised?

A generative model learns the joint probability P(X,Y) then uses Bayes theorem to compute the conditional probability P(Y|X). However, the RBM is an unsupervised feature extractor. There is no Y!

How can the RBM be said to be an unsupervised algorithm, but also generative?

The definition of generative model as learning the joint probability $P(X,Y)$ is given in the context of supervised learning.

In a more general setting, the process of learning the joint probability is "generative" because knowing the joint probability allows the generation of new data - in the supervised context, having $P(X,Y)$ gives the possibility to generate new $(x,y)$ pairs.

Now, what does generative mean in the unsupervised learning context? It means sampling. And sampling is something RBM can do very conveniently, because the lack of inter-layer connections makes Gibbs sampling particularly easy.

Leaving the details of Gibbs sampling aside, it is worth to note that in case of RBM we have in fact $P(v,h)$ where $v$ is the visible layer and $h$ is the hidden layer.

Clarification

Sampling is used in different contexts referring to different ideas. I am often somehow sloppy in the use of this term myself.

In the context of the answer, with sampling I mean generating new samples as opposed to sampling from an available set of elements (just picking a bunch of them with/or without replacement, for example).

In order to be able to generate new (x,y) pairs, you need to model the joint distribution and then sample from it (as done here in a more trivial example where the distribution is just a gaussian).

• How is generating new samples different from sampling? – cangrejo Oct 11 '17 at 13:04

Lets X=(x1,x2,x3,x4,x5) and let the target variable Y=(y1,y2). Generative model learns a joint probability distribution P(X,Y)=P(x1,x2,x3,x4,x5,y1,y2). So now think of this P(X,Y) in the form of a table with all these variables and with another column appended to it as the probability of the particular configuration of the variable values. Generative model as you know defines how likely the label(y1,y2) generated the data(x1,x2,x3,x4.x5). Now consider this, if my data is (x1,x2,x3,x4,x5,x6,x7) then I can learn a joint probability distribution and use bayes theorem to fill in any missing values like (x3,x7) as P(x3,x7|(x1,x2,x4,x5,x6)). These missing values can be your target variable too. Now you can call them target variable or whatever. But the point here is that generative model defines joint probability distribution over variables irrelevant to what names you give them. Since RBM defines joint probability distribution on input variables that is basically just the data and no labels it is therefore unsupervised learning.

Just like Naive Bayes the RBM is a form of unsupervised learning because the learner does not distinguish the class variable from the attribute variables in the data. They are treated all the same to compute the Gibbs distribution.