#NEWLINE# def resample_bias_noise( self , batch_size_changed = False ) : #NEWLINE# #INDENT# '\n        .. todo::\n\n            WRITEME\n        ' #NEWLINE# if batch_size_changed : #NEWLINE# #INDENT# self . resample_fn = None #NEWLINE# #UNINDENT# if ( self . resample_fn is None ) : #NEWLINE# #INDENT# updates = OrderedDict ( ) #NEWLINE# if ( self . sampling_b_stdev is not None ) : #NEWLINE# #INDENT# self . noisy_sampling_b = sharedX ( np . zeros ( ( self . dbm . batch_size , self . nvis ) ) ) #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 = ising_b . boltzmann_bias #NEWLINE# W_above = 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 #NEWLINE# #UNINDENT# self . resample_fn = function ( [ ] , updates = updates ) #NEWLINE# #UNINDENT# self . resample_fn ( )