def _joint_probabilities(distances, desired_perplexity, verbose):
 distances = astype(distances, np.float32, copy=False)
 conditional_P = _utils._binary_search_perplexity(distances, None, desired_perplexity, verbose)
 P = (conditional_P + conditional_P.T)
 sum_P = np.maximum(np.sum(P), MACHINE_EPSILON)
 P = np.maximum((squareform(P) / sum_P), MACHINE_EPSILON)
 return P

def _joint_probabilities ( distances , desired_perplexity , verbose ) : distances = astype ( distances , np . float32 , copy = False ) conditional_P = _utils . _binary_search_perplexity ( distances , None , desired_perplexity , verbose ) P = ( conditional_P + conditional_P . T ) sum_P = np . maximum ( np . sum ( P ) , MACHINE_EPSILON ) P = np . maximum ( ( squareform ( P ) / sum_P ) , MACHINE_EPSILON ) return P
compute joint probabilities p_ij from distances .