#NEWLINE# def _sample_visibles( self , h , rng ) : #NEWLINE# #INDENT# 'Sample from the distribution P(v|h).\n\n        Parameters\n        ----------\n        h : array-like, shape (n_samples, n_components)\n            Values of the hidden layer to sample from.\n\n        rng : RandomState\n            Random number generator to use.\n\n        Returns\n        -------\n        v : array-like, shape (n_samples, n_features)\n            Values of the visible layer.\n        ' #NEWLINE# p = np . dot ( h , self . components_ ) #NEWLINE# p += self . intercept_visible_ #NEWLINE# expit ( p , out = p ) #NEWLINE# return ( rng . random_sample ( size = self . shape ) < p )