tirank.Loss.gaussian_kernel
- tirank.Loss.gaussian_kernel(a, b, sigma=1.0)[source]
Calculates the Gaussian (RBF) kernel similarity between two tensors.
- Parameters:
a (torch.Tensor) – First input tensor (samples x features).
b (torch.Tensor) – Second input tensor (samples x features).
sigma (float, optional) – The sigma value (bandwidth) of the Gaussian kernel. Defaults to 1.0.
- Returns:
The pairwise Gaussian kernel similarity matrix.
- Return type:
torch.Tensor