@@ -0,0 +1,593 @@
+# regressions.kernels%0A%0A%22%22%22A collection of kernels and kernel generators%22%22%22%0A%0Aimport math%0A%0Afrom . import *%0A%0A%0Adef std_gaussian(x, y):%0A    %22%22%22A Gaussian kernel with width 1%22%22%22%0A%0A    return 0.3989422804014327 * math.exp(- 0.5 * np.sum((x-y)**2))%0A%0A%0Adef make_gaussian_kernel(width=1.0):%0A    %22%22%22Returns a function that implements a Gaussian kernel with the width%0A    specified%22%22%22%0A%0A    normalization = 1.0 / math.sqrt(2.0 * math.pi * width)%0A    scale = 1.0 / (2.0 * width**2)%0A%0A    def gaussian_kernel(x, y):%0A        return normalization * math.exp(-scale * np.sum((x-y)**2))%0A%0A    return gaussian_kernel%0A

Add regressions.kernels