#NEWLINE# def _modify_updates( self , updates ) : #NEWLINE# #INDENT# '\n        .. todo::\n\n            WRITEME\n        ' #NEWLINE# beta = self . beta #NEWLINE# if ( beta in updates ) : #NEWLINE# #INDENT# updated_beta = updates [ beta ] #NEWLINE# updates [ beta ] = T . clip ( updated_beta , 1.0 , 1000.0 ) #NEWLINE# #UNINDENT# if any ( ( ( constraint is not None ) for constraint in [ self . min_ising_b , self . max_ising_b ] ) ) : #NEWLINE# #INDENT# bmn = self . min_ising_b #NEWLINE# if ( bmn is None ) : #NEWLINE# #INDENT# bmn = ( - 1000000.0 ) #NEWLINE# #UNINDENT# bmx = self . max_ising_b #NEWLINE# if ( bmx is None ) : #NEWLINE# #INDENT# bmx = 1000000.0 #NEWLINE# #UNINDENT# wmn_above = self . layer_above . min_ising_W #NEWLINE# if ( wmn_above is None ) : #NEWLINE# #INDENT# wmn_above = ( - 1000000.0 ) #NEWLINE# #UNINDENT# wmx_above = self . layer_above . max_ising_W #NEWLINE# if ( wmx_above is None ) : #NEWLINE# #INDENT# wmx_above = 1000000.0 #NEWLINE# #UNINDENT# b = updates [ self . boltzmann_bias ] #NEWLINE# W_above = updates [ self . layer_above . W ] #NEWLINE# ising_b = ( ( 0.5 * b ) + ( 0.25 * W_above . sum ( axis = 1 ) ) ) #NEWLINE# ising_b = T . clip ( ising_b , bmn , bmx ) #NEWLINE# ising_W_above = ( 0.25 * W_above ) #NEWLINE# ising_W_above = T . clip ( ising_W_above , wmn_above , wmx_above ) #NEWLINE# bhn = ( 2.0 * ( ising_b - ising_W_above . sum ( axis = 1 ) ) ) #NEWLINE# updates [ self . boltzmann_bias ] = bhn #NEWLINE# #UNINDENT# if ( self . noisy_sampling_b is not None ) : #NEWLINE# #INDENT# theano_rng = make_theano_rng ( None , self . dbm . rng . randint ( ( 2 ** 16 ) ) , which_method = 'normal' ) #NEWLINE# b = updates [ self . boltzmann_bias ] #NEWLINE# W_above = updates [ self . layer_above . W ] #NEWLINE# ising_b = ( ( 0.5 * b ) + ( 0.25 * W_above . sum ( axis = 1 ) ) ) #NEWLINE# noisy_sampling_b = theano_rng . normal ( avg = ising_b . dimshuffle ( 'x' , 0 ) , std = self . sampling_b_stdev , size = self . noisy_sampling_b . shape , dtype = ising_b . dtype ) #NEWLINE# updates [ self . noisy_sampling_b ] = noisy_sampling_b