added a constructor for a generic sympy kernel

This commit is contained in:
James Hensman 2012-12-18 15:45:52 +00:00
parent 304947d6cd
commit e29dc1c9dd
3 changed files with 8 additions and 2 deletions

View file

@ -188,3 +188,9 @@ def rbf_sympy(D,variance=1., lengthscale=1.):
dist = parse_expr(dist_string)
f = rbf_variance*sp.exp(-dist/(2*rbf_lengthscale**2))
return kern(D,[spkern(D,f,np.array([variance,lengthscale]))])
def sympykern(D,k):
"""
A kernel from a symbolic sympy representation
"""
return kern(D,[spkern(D,k)])