neuroprob/nonparametrics.py
def compute_F(self, XZ):
        """
        Computes :math:`p(f(x)|u)` and also updating :math:`L_{uu}` matrix
        model call uses :math:`L_{uu}` for the MVN, call after this function
        
        Computes the mean and covariance matrix (or variance) of Gaussian Process
        posterior on a test input data :math:`X_{new}`:
        
        .. math:: p(f^* \mid X_{new}, X, y, k, X_u, u_{loc}, u_{scale\_tril})
            = \mathcal{N}(loc, cov).
            
        .. note:: Variational parameters ``u_loc``, ``u_scale_tril``, the
            inducing-point parameter ``Xu``, together with kernel's parameters have
            been learned.
        
        covariance_type is a flag to decide if we want to predict full covariance matrix or 
        just variance.
        
        .. note:: The GP is centered around zero with fixed zero mean, but a learnable 
            mean is added after computing the posterior to get the mapping mean.
        
        
        :param X: input regressors with shape (samples, timesteps, dims)
        :returns: loc and covariance matrix (or variance) of :math:`p(f^*(X_{new}))`
        :rtype: tuple(torch.Tensor, torch.Tensor)
        """
        #if self.shared_kernel_params:
        #    loc, cov, self.Luu = linalg.pFU_shared(self.out_dims, X, self.Xu, self.kernel, self.u_loc, self.u_scale_tril,
        #                       cov_type=self.covariance_type, whiten=self.whiten, jitter=self.jitter)
        #else:
        XZ = self._XZ(XZ)
        if self.gp_mode == 'sparse' or self.gp_mode == 'sparse_MAP':
            loc, cov, self.Luu = linalg.p_F_U(self.out_dims, XZ, self.Xu, self.kernel, self.u_loc, self.u_scale_tril,
                                                 cov_type=self.covariance_type, whiten=self.whiten, jitter=self.jitter)
        else:
            loc, cov, self.Lff = linalg.p_F_U(self.out_dims, XZ, self.Xf, self.kernel, self.f_loc, self.f_scale_tril, 
                                                 cov_type=self.covariance_type, whiten=False, jitter=self.jitter)
        
        return loc + self.mean_function(XZ), cov

        Computes :math:`p(f(x)|u)` and also updating :math:`L_{uu}` matrix
        model call uses :math:`L_{uu}` for the MVN, call after this function
        
        Computes the mean and covariance matrix (or variance) of Gaussian Process
        posterior on a test input data :math:`X_{new}`:
        
        .. math:: p(f^* \mid X_{new}, X, y, k, X_u, u_{loc}, u_{scale\_tril})
            = \mathcal{N}(loc, cov).
            
        .. note:: Variational parameters ``u_loc``, ``u_scale_tril``, the
            inducing-point parameter ``Xu``, together with kernel's parameters have
            been learned.
        
        covariance_type is a flag to decide if we want to predict full covariance matrix or 
        just variance.
        
        .. note:: The GP is centered around zero with fixed zero mean, but a learnable 
            mean is added after computing the posterior to get the mapping mean.
        
        
        :param X: input regressors with shape (samples, timesteps, dims)
        :returns: loc and covariance matrix (or variance) of :math:`p(f^*(X_{new}))`
        :rtype: tuple(torch.Tensor, torch.Tensor)
        


Computes the mean and covariance matrix (or variance) of Gaussian Process
posterior on a test input data :math:`X_{new}`.





covariance_type is a flag to decide if we want to predict full covariance matrix or
just variance.

: The GP is centered around zero with fixed zero mean, but a learnable
mean is added after computing the posterior to get the mapping mean.
Computes the mean and covariance matrix ( or variance ) of Gaussian Process posterior on a test input data : math : ` X_ { new } ` . covariance_type is a flag to decide if we want to predict full covariance matrix or just variance . : The GP is centered around zero with fixed zero mean but a learnable mean is added after computing the posterior to get the mapping mean .
def compute_F(self, XZ):
        XZ = self._XZ(XZ)
        if self.gp_mode == 'sparse' or self.gp_mode == 'sparse_MAP':
            loc, cov, self.Luu = linalg.p_F_U(self.out_dims, XZ, self.Xu, self.kernel, self.u_loc, self.u_scale_tril,
                                                 cov_type=self.covariance_type, whiten=self.whiten, jitter=self.jitter)
        else:
            loc, cov, self.Lff = linalg.p_F_U(self.out_dims, XZ, self.Xf, self.kernel, self.f_loc, self.f_scale_tril, 
                                                 cov_type=self.covariance_type, whiten=False, jitter=self.jitter)
        return loc + self.mean_function(XZ), cov
def compute_F ( self , XZ ) : XZ = self . _XZ ( XZ ) if self . gp_mode == 'sparse' or self . gp_mode == 'sparse_MAP' : loc , cov , self . Luu = linalg . p_F_U ( self . out_dims , XZ , self . Xu , self . kernel , self . u_loc , self . u_scale_tril , cov_type = self . covariance_type , whiten = self . whiten , jitter = self . jitter ) else : loc , cov , self . Lff = linalg . p_F_U ( self . out_dims , XZ , self . Xf , self . kernel , self . f_loc , self . f_scale_tril , cov_type = self . covariance_type , whiten = False , jitter = self . jitter ) return loc + self . mean_function ( XZ ) , cov
Computes :math:`p(f(x)|u)` and also updating :math:`L_{uu}` matrix
model call uses :math:`L_{uu}` for the MVN, call after this function
Computes : math : ` p ( f ( x ) |u ) ` and also updating : math : ` L_ { uu } ` matrix model call uses : math : ` L_ { uu } ` for the MVN call after this function
"""
        Computes :math:`p(f(x)|u)` and also updating :math:`L_{uu}` matrix
        model call uses :math:`L_{uu}` for the MVN, call after this function
        
        Computes the mean and covariance matrix (or variance) of Gaussian Process
        posterior on a test input data :math:`X_{new}`:
        
        .. math:: p(f^* \mid X_{new}, X, y, k, X_u, u_{loc}, u_{scale\_tril})
            = \mathcal{N}(loc, cov).
            
        .. note:: Variational parameters ``u_loc``, ``u_scale_tril``, the
            inducing-point parameter ``Xu``, together with kernel's parameters have
            been learned.
        
        covariance_type is a flag to decide if we want to predict full covariance matrix or 
        just variance.
        
        .. note:: The GP is centered around zero with fixed zero mean, but a learnable 
            mean is added after computing the posterior to get the mapping mean.
        
        
        :param X: input regressors with shape (samples, timesteps, dims)
        :returns: loc and covariance matrix (or variance) of :math:`p(f^*(X_{new}))`
        :rtype: tuple(torch.Tensor, torch.Tensor)
        """ #if self.shared_kernel_params: #    loc, cov, self.Luu = linalg.pFU_shared(self.out_dims, X, self.Xu, self.kernel, self.u_loc, self.u_scale_tril, #                       cov_type=self.covariance_type, whiten=self.whiten, jitter=self.jitter) #else:
loc and covariance matrix (or variance) of :math:`p(f^*(X_{new}))`
loc and covariance matrix ( or variance ) of : math : ` p ( f^ * ( X_ { new } )) `
tuple(torch.Tensor, torch.Tensor)
self
XZ
X
input regressors with shape (samples, timesteps, dims)
input regressors with shape ( samples timesteps dims )