mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-09 12:02:38 +02:00
added a constructor for a generic sympy kernel
This commit is contained in:
parent
304947d6cd
commit
e29dc1c9dd
3 changed files with 8 additions and 2 deletions
|
|
@ -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)])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue