original_docstring: Compute the perplexity and the P-row for a specific value of the precision of a Gaussian distribution.
docstring: Compute the perplexity and the P-row for a specific value of the precision of a Gaussian distribution.
docstring_tokens: Compute the perplexity and the P - row for a specific value of the precision of a Gaussian distribution .
code: def Hbeta(D, beta = 1.0):
  	"""Compute the perplexity and the P-row for a specific value of the precision of a Gaussian distribution."""
  	
  	# Compute P-row and corresponding perplexity
  	P = np.exp(-D.copy() * beta);
  	sumP = sum(P);
  	H = np.log(sumP) + beta * np.sum(D * P) / sumP;
  	P = P / sumP;
  	return H, P;
code_tokens: def Hbeta ( D , beta = 1.0 ) : P = np . exp ( - D . copy ( ) * beta ) ; sumP = sum ( P ) ; H = np . log ( sumP ) + beta * np . sum ( D * P ) / sumP ; P = P / sumP ; return H , P ;
short_docstring: Compute the perplexity and the P-row for a specific value of the precision of a Gaussian distribution.
short_docstring_tokens: Compute the perplexity and the P - row for a specific value of the precision of a Gaussian distribution .
comment: """Compute the perplexity and the P-row for a specific value of the precision of a Gaussian distribution."""$SEP$# Compute P-row and corresponding perplexity