# How do we calculate the hidden units values in a (Restricted) Boltzmann machine

The way I understand it is that hidden units are added to capture higher order interactions offering more capacity to the model. Now, the BM family are energy based undirected networks, meaning there's no forward computations; instead, for each input configuration x, a scalar energy is calculated to asses this configuration. (the higher the energy, the less likely for x to be sampled from the target distribution.)

The probability distribution is defined through the energy function by summing over all possible states of the hidden part h. So, my question is: how do we calculate the values of these hidden units? Or do we not explicitly compute these valus and instead approximate the marginal "free energy" which is the negative log of the sum over all possible states of h?