maxframe.learn.metrics.pairwise.rbf_kernel#

maxframe.learn.metrics.pairwise.rbf_kernel(X, Y=None, gamma=None)[源代码]#

计算 X 和 Y 之间的 rbf(高斯)核::

K(x, y) = exp(-gamma ||x-y||^2)

对于 X 中的每一行 x 和 Y 中的每一行 y。

更多内容请参见 用户指南

参数:
  • X (tensor of shape (n_samples_X, n_features))

  • Y (tensor of shape (n_samples_Y, n_features))

  • gamma (float, default None) -- 如果为 None,默认为 1.0 / n_features

返回:

核矩阵

返回类型:

tensor of shape (n_samples_X, n_samples_Y)