def _bayes_thresh(details, var):
 dvar = np.mean((details * details))
 eps = np.finfo(details.dtype).eps
 thresh = (var / np.sqrt(max((dvar - var), eps)))
 return thresh

def _bayes_thresh ( details , var ) : dvar = np . mean ( ( details * details ) ) eps = np . finfo ( details . dtype ) . eps thresh = ( var / np . sqrt ( max ( ( dvar - var ) , eps ) ) ) return thresh
bayesshrink threshold for a zero-mean details coeff array .