matchzoo.modules.gaussian_kernel
¶
Gaussian kernel module.
Module Contents¶
-
class
matchzoo.modules.gaussian_kernel.
GaussianKernel
(mu: float = 1.0, sigma: float = 1.0)¶ Bases:
torch.nn.Module
Gaussian kernel module.
Parameters: - mu – Float, mean of the kernel.
- sigma – Float, sigma of the kernel.
Examples
>>> import torch >>> kernel = GaussianKernel() >>> x = torch.randn(4, 5, 10) >>> x.shape torch.Size([4, 5, 10]) >>> kernel(x).shape torch.Size([4, 5, 10])
-
forward
(self, x)¶ Forward.