kernels.py
def forward(self, X: Tensor, Y: Tensor = None) -> Tensor:
        """
        Computes the kernel matrix for some observation matrices X and Y.
        :param X: d x N matrix
        :param Y: d x M matrix. If not specified, it is assumed to be X.
        :return: N x M kernel matrix
        """
        if Y is None:
            Y = X
        N = X.shape[1] if len(X.shape) > 1 else 1
        M = Y.shape[1] if len(Y.shape) > 1 else 1

        return torch.mm(X.t(), Y)

        Computes the kernel matrix for some observation matrices X and Y.
        :param X: d x N matrix
        :param Y: d x M matrix. If not specified, it is assumed to be X.
        :return: N x M kernel matrix
        
Computes the kernel matrix for some observation matrices X and Y.
Computes the kernel matrix for some observation matrices X and Y .
def forward(self, X: Tensor, Y: Tensor = None) -> Tensor:
        if Y is None:
            Y = X
        N = X.shape[1] if len(X.shape) > 1 else 1
        M = Y.shape[1] if len(Y.shape) > 1 else 1
        return torch.mm(X.t(), Y)
def forward ( self , X : Tensor , Y : Tensor = None ) -> Tensor : if Y is None : Y = X N = X . shape [ 1 ] if len ( X . shape ) > 1 else 1 M = Y . shape [ 1 ] if len ( Y . shape ) > 1 else 1 return torch . mm ( X . t ( ) , Y )
Computes the kernel matrix for some observation matrices X and Y.
Computes the kernel matrix for some observation matrices X and Y .
"""
        Computes the kernel matrix for some observation matrices X and Y.
        :param X: d x N matrix
        :param Y: d x M matrix. If not specified, it is assumed to be X.
        :return: N x M kernel matrix
        """
N x M kernel matrix
N x M kernel matrix
self
X
Tensor
d x N matrix
d x N matrix
Y
Tensor
d x M matrix. If not specified, it is assumed to be X.
d x M matrix . If not specified it is assumed to be X .