mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-09 12:02:38 +02:00
Added symmtrical covariance functions
This commit is contained in:
parent
054faae4af
commit
f2ce47d96e
3 changed files with 103 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ from periodic_Matern32 import periodic_Matern32 as periodic_Matern32part
|
|||
from periodic_Matern52 import periodic_Matern52 as periodic_Matern52part
|
||||
from product import product as productpart
|
||||
from product_orthogonal import product_orthogonal as product_orthogonalpart
|
||||
from symmetric import symmetric as symmetric_part
|
||||
#TODO these s=constructors are not as clean as we'd like. Tidy the code up
|
||||
#using meta-classes to make the objects construct properly wthout them.
|
||||
|
||||
|
|
@ -264,3 +265,12 @@ def product_orthogonal(k1,k2):
|
|||
"""
|
||||
part = product_orthogonalpart(k1,k2)
|
||||
return kern(k1.D+k2.D, [part])
|
||||
|
||||
def symmetric(k):
|
||||
"""
|
||||
Construct a symmetrical kernel from an existing kernel
|
||||
"""
|
||||
k_ = k.copy()
|
||||
k_.parts = [symmetric_part(p) for p in k.parts]
|
||||
return k_
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue