'Sample from the distribution P(v|h).
Parameters
h : array-like, shape (n_samples, n_components)
Values of the hidden layer to sample from.
rng : RandomState
Random number generator to use.
Returns
v : array-like, shape (n_samples, n_features)
Values of the visible layer.'

def _sample_visibles(self, h, rng):

    p = np.dot(h, self.components_)
    p += self.intercept_visible_
    expit(p, out=p)
    return (rng.random_sample(size=p.shape) < p)
