r"""Compute kernel matrix
(x1, x2, method="gaussian", sigma=1, **kwargs)
| 40 | |
| 41 | |
| 42 | def kernel(x1, x2, method="gaussian", sigma=1, **kwargs): |
| 43 | r"""Compute kernel matrix""" |
| 44 | |
| 45 | nx = get_backend(x1, x2) |
| 46 | |
| 47 | if method.lower() in ["gaussian", "gauss", "rbf"]: |
| 48 | K = nx.exp(-dist(x1, x2) / (2 * sigma**2)) |
| 49 | return K |
| 50 | |
| 51 | |
| 52 | def laplacian(x): |
no test coverage detected