def metropolis_hastings_accept(energy_prev, energy_next, s_rng):
 ediff = (energy_prev - energy_next)
 return ((TT.exp(ediff) - s_rng.uniform(size=energy_prev.shape)) >= 0)

def metropolis_hastings_accept ( energy_prev , energy_next , s_rng ) : ediff = ( energy_prev - energy_next ) return ( ( TT . exp ( ediff ) - s_rng . uniform ( size = energy_prev . shape ) ) >= 0 )
performs a metropolis-hastings accept-reject move .