#NEWLINE# def sample( self , visible_0_state ) : #NEWLINE# #INDENT# assert ( self . model_distribution . size_visible in visible_0_state . shape ) #NEWLINE# ( hidden_0_prob , hidden_0_state ) = self . model_distribution . state_h ( visible_0_state ) #NEWLINE# visible_k_state = np . copy ( visible_0_state ) #NEWLINE# hidden_k_state = np . copy ( hidden_0_state ) #NEWLINE# for step in range ( self . sampling_steps ) : #NEWLINE# #INDENT# ( visible_k_prob , visible_k_state ) = self . model_distribution . state_v ( hidden_k_state ) #NEWLINE# ( hidden_k_prob , hidden_k_state ) = self . model_distribution . state_h ( visible_k_state ) #NEWLINE# #UNINDENT# return ( hidden_0_prob , hidden_0_state , hidden_k_prob , hidden_k_state , visible_k_prob , visible_k_state )