mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-24 14:15:14 +02:00
all the product_orthogonal have been changed to prod_orthogonal for consistency
This commit is contained in:
parent
f881e65761
commit
ec748e2d6b
5 changed files with 13 additions and 13 deletions
|
|
@ -2,5 +2,5 @@
|
||||||
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||||
|
|
||||||
|
|
||||||
from constructors import rbf, Matern32, Matern52, exponential, linear, white, bias, finite_dimensional, spline, Brownian, rbf_sympy, sympykern, periodic_exponential, periodic_Matern32, periodic_Matern52, product, product_orthogonal, symmetric, coregionalise
|
from constructors import rbf, Matern32, Matern52, exponential, linear, white, bias, finite_dimensional, spline, Brownian, rbf_sympy, sympykern, periodic_exponential, periodic_Matern32, periodic_Matern52, prod, prod_orthogonal, symmetric, coregionalise
|
||||||
from kern import kern
|
from kern import kern
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ from Brownian import Brownian as Brownianpart
|
||||||
from periodic_exponential import periodic_exponential as periodic_exponentialpart
|
from periodic_exponential import periodic_exponential as periodic_exponentialpart
|
||||||
from periodic_Matern32 import periodic_Matern32 as periodic_Matern32part
|
from periodic_Matern32 import periodic_Matern32 as periodic_Matern32part
|
||||||
from periodic_Matern52 import periodic_Matern52 as periodic_Matern52part
|
from periodic_Matern52 import periodic_Matern52 as periodic_Matern52part
|
||||||
from product import product as productpart
|
from prod import prod as prodpart
|
||||||
from product_orthogonal import product_orthogonal as product_orthogonalpart
|
from prod_orthogonal import prod_orthogonal as prod_orthogonalpart
|
||||||
from symmetric import symmetric as symmetric_part
|
from symmetric import symmetric as symmetric_part
|
||||||
from coregionalise import coregionalise as coregionalise_part
|
from coregionalise import coregionalise as coregionalise_part
|
||||||
#TODO these s=constructors are not as clean as we'd like. Tidy the code up
|
#TODO these s=constructors are not as clean as we'd like. Tidy the code up
|
||||||
|
|
@ -245,7 +245,7 @@ def periodic_Matern52(D,variance=1., lengthscale=None, period=2*np.pi,n_freq=10,
|
||||||
part = periodic_Matern52part(D,variance, lengthscale, period, n_freq, lower, upper)
|
part = periodic_Matern52part(D,variance, lengthscale, period, n_freq, lower, upper)
|
||||||
return kern(D, [part])
|
return kern(D, [part])
|
||||||
|
|
||||||
def product(k1,k2):
|
def prod(k1,k2):
|
||||||
"""
|
"""
|
||||||
Construct a product kernel over D from two kernels over D
|
Construct a product kernel over D from two kernels over D
|
||||||
|
|
||||||
|
|
@ -253,10 +253,10 @@ def product(k1,k2):
|
||||||
:type k1, k2: kernpart
|
:type k1, k2: kernpart
|
||||||
:rtype: kernel object
|
:rtype: kernel object
|
||||||
"""
|
"""
|
||||||
part = productpart(k1,k2)
|
part = prodpart(k1,k2)
|
||||||
return kern(k1.D, [part])
|
return kern(k1.D, [part])
|
||||||
|
|
||||||
def product_orthogonal(k1,k2):
|
def prod_orthogonal(k1,k2):
|
||||||
"""
|
"""
|
||||||
Construct a product kernel over D1 x D2 from a kernel over D1 and another over D2.
|
Construct a product kernel over D1 x D2 from a kernel over D1 and another over D2.
|
||||||
|
|
||||||
|
|
@ -264,7 +264,7 @@ def product_orthogonal(k1,k2):
|
||||||
:type k1, k2: kernpart
|
:type k1, k2: kernpart
|
||||||
:rtype: kernel object
|
:rtype: kernel object
|
||||||
"""
|
"""
|
||||||
part = product_orthogonalpart(k1,k2)
|
part = prod_orthogonalpart(k1,k2)
|
||||||
return kern(k1.D+k2.D, [part])
|
return kern(k1.D+k2.D, [part])
|
||||||
|
|
||||||
def symmetric(k):
|
def symmetric(k):
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ import pylab as pb
|
||||||
from ..core.parameterised import parameterised
|
from ..core.parameterised import parameterised
|
||||||
from kernpart import kernpart
|
from kernpart import kernpart
|
||||||
import itertools
|
import itertools
|
||||||
from product_orthogonal import product_orthogonal
|
from prod_orthogonal import prod_orthogonal
|
||||||
from product import product
|
from prod import prod
|
||||||
|
|
||||||
class kern(parameterised):
|
class kern(parameterised):
|
||||||
def __init__(self,D,parts=[], input_slices=None):
|
def __init__(self,D,parts=[], input_slices=None):
|
||||||
|
|
@ -161,7 +161,7 @@ class kern(parameterised):
|
||||||
K1 = self.copy()
|
K1 = self.copy()
|
||||||
K2 = other.copy()
|
K2 = other.copy()
|
||||||
|
|
||||||
newkernparts = [product(k1,k2) for k1, k2 in itertools.product(K1.parts,K2.parts)]
|
newkernparts = [prod(k1,k2) for k1, k2 in itertools.product(K1.parts,K2.parts)]
|
||||||
|
|
||||||
slices = []
|
slices = []
|
||||||
for sl1, sl2 in itertools.product(K1.input_slices,K2.input_slices):
|
for sl1, sl2 in itertools.product(K1.input_slices,K2.input_slices):
|
||||||
|
|
@ -183,7 +183,7 @@ class kern(parameterised):
|
||||||
K1 = self.copy()
|
K1 = self.copy()
|
||||||
K2 = other.copy()
|
K2 = other.copy()
|
||||||
|
|
||||||
newkernparts = [product_orthogonal(k1,k2) for k1, k2 in itertools.product(K1.parts,K2.parts)]
|
newkernparts = [prod_orthogonal(k1,k2) for k1, k2 in itertools.product(K1.parts,K2.parts)]
|
||||||
|
|
||||||
slices = []
|
slices = []
|
||||||
for sl1, sl2 in itertools.product(K1.input_slices,K2.input_slices):
|
for sl1, sl2 in itertools.product(K1.input_slices,K2.input_slices):
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import numpy as np
|
||||||
import hashlib
|
import hashlib
|
||||||
#from scipy import integrate # This may not be necessary (Nicolas, 20th Feb)
|
#from scipy import integrate # This may not be necessary (Nicolas, 20th Feb)
|
||||||
|
|
||||||
class product(kernpart):
|
class prod(kernpart):
|
||||||
"""
|
"""
|
||||||
Computes the product of 2 kernels that are defined on the same space
|
Computes the product of 2 kernels that are defined on the same space
|
||||||
|
|
||||||
|
|
@ -6,7 +6,7 @@ import numpy as np
|
||||||
import hashlib
|
import hashlib
|
||||||
#from scipy import integrate # This may not be necessary (Nicolas, 20th Feb)
|
#from scipy import integrate # This may not be necessary (Nicolas, 20th Feb)
|
||||||
|
|
||||||
class product_orthogonal(kernpart):
|
class prod_orthogonal(kernpart):
|
||||||
"""
|
"""
|
||||||
Computes the product of 2 kernels
|
Computes the product of 2 kernels
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue