#NEWLINE# def predict_wishart_embedding( self , Xnew , kern = None , mean = True , covariance = True ) : #NEWLINE# #INDENT# '\n        Predict the wishart embedding G of the GP. This is the density of the\n        input of the GP defined by the probabilistic function mapping f.\n        G = J_mean.T*J_mean + output_dim*J_cov.\n\n        :param array-like Xnew: The points at which to evaluate the magnification.\n        :param :py:class:`~GPy.kern.Kern` kern: The kernel to use for the magnification.\n\n        Supplying only a part of the learning kernel gives insights into the density\n        of the specific kernel part of the input function. E.g. one can see how dense the\n        linear part of a kernel is compared to the non-linear part etc.\n        ' #NEWLINE# if ( kern is None ) : #NEWLINE# #INDENT# kern = self . kern #NEWLINE# #UNINDENT# ( mu_jac , var_jac ) = self . predict_jacobian ( Xnew , kern , full_cov = False ) #NEWLINE# mumuT = np . einsum ( 'iqd,ipd->iqp' , mu_jac , mu_jac ) #NEWLINE# Sigma = np . zeros ( mumuT . shape ) #NEWLINE# if ( var_jac . ndim == 3 ) : #NEWLINE# #INDENT# Sigma [ ( ( slice ( None ) , ) + np . diag_indices ( Xnew . shape [ 1 ] , 2 ) ) ] = var_jac . sum ( ( - 1 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# Sigma [ ( ( slice ( None ) , ) + np . diag_indices ( Xnew . shape [ 1 ] , 2 ) ) ] = ( self . output_dim * var_jac ) #NEWLINE# #UNINDENT# G = 0.0 #NEWLINE# if mean : #NEWLINE# #INDENT# G += mumuT #NEWLINE# #UNINDENT# if covariance : #NEWLINE# #INDENT# G += Sigma #NEWLINE# #UNINDENT# return G