#NEWLINE# def sample( self , state_below = None , state_above = None , layer_above = None , theano_rng = None ) : #NEWLINE# #INDENT# '\n        .. todo::\n\n            WRITEME\n        ' #NEWLINE# assert ( state_below is None ) #NEWLINE# msg = layer_above . downward_message ( state_above ) #NEWLINE# bias = self . bias #NEWLINE# z = ( msg + bias ) #NEWLINE# phi = T . nnet . sigmoid ( ( ( 2.0 * self . beta ) * z ) ) #NEWLINE# rval = theano_rng . binomial ( size = phi . shape , p = phi , dtype = phi . dtype , n = 1 ) #NEWLINE# return ( ( rval * 2.0 ) - 1.0 )