From ea4599f1d0daf6c8697c6bcecd429998a013b986 Mon Sep 17 00:00:00 2001 From: Andreas Date: Mon, 15 Jul 2013 20:12:54 +0100 Subject: [PATCH] Added rbf_inv.py kernel which is parametrised with the variances --- GPy/kern/constructors.py | 17 +++++++++++++++++ GPy/kern/parts/__init__.py | 1 + 2 files changed, 18 insertions(+) diff --git a/GPy/kern/constructors.py b/GPy/kern/constructors.py index 724c13cc..b549e139 100644 --- a/GPy/kern/constructors.py +++ b/GPy/kern/constructors.py @@ -5,6 +5,23 @@ import numpy as np from kern import kern import parts + +def rbf_inv(input_dim,variance=1., inv_lengthscale=None,ARD=False): + """ + Construct an RBF kernel + + :param input_dim: dimensionality of the kernel, obligatory + :type input_dim: int + :param variance: the variance of the kernel + :type variance: float + :param lengthscale: the lengthscale of the kernel + :type lengthscale: float + :param ARD: Auto Relevance Determination (one lengthscale per dimension) + :type ARD: Boolean + """ + part = parts.rbf_inv.RBFInv(input_dim,variance,inv_lengthscale,ARD) + return kern(input_dim, [part]) + def rbf(input_dim,variance=1., lengthscale=None,ARD=False): """ Construct an RBF kernel diff --git a/GPy/kern/parts/__init__.py b/GPy/kern/parts/__init__.py index f9b40888..e39b70c2 100644 --- a/GPy/kern/parts/__init__.py +++ b/GPy/kern/parts/__init__.py @@ -20,3 +20,4 @@ import spline import symmetric import white import hierarchical +import rbf_inv