kernel.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:addc 作者: carsonfarmer 项目源码 文件源码
def exponential(x, y, sigma=1):
    """Compute an exponential kernel.

    The exponential kernel is closely related to the Gaussian kernel, with
    only the square of the norm left out. It is also a radial basis function
    kernel:
                    K(x, y) = exp(-||x - y|| / 2?^2)
    where `x` and `y` are vectors in the input space (i.e., vectors of
    features computed from training or test samples), ``||x - y||` is the
    Euclidean norm, and the adjustable parameter `sigma` is used to adjust
    the kernel 'bandwidth'. It is important to note that the observations made
    about the `sigma` parameter for the Gaussian kernel also apply to the
    Exponential and Laplacian kernels.

    See Also
    --------
    gaussian
    """
    return exp(-(dist.euclidean(x, y) / 2*sigma**2))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号