From c12ca4c53d625d9ccf5da0ab749e53f145e60ab6 Mon Sep 17 00:00:00 2001 From: James Hensman Date: Thu, 14 Nov 2013 08:54:05 +0000 Subject: [PATCH 1/3] a trial namespace renaming --- GPy/models/__init__.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/GPy/models/__init__.py b/GPy/models/__init__.py index 10ce577b..a8be5890 100644 --- a/GPy/models/__init__.py +++ b/GPy/models/__init__.py @@ -1,18 +1,19 @@ # Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) -from gp_regression import GPRegression -from gp_classification import GPClassification -from sparse_gp_regression import SparseGPRegression -from svigp_regression import SVIGPRegression -from sparse_gp_classification import SparseGPClassification -from fitc_classification import FITCClassification -from gplvm import GPLVM -from bcgplvm import BCGPLVM -from sparse_gplvm import SparseGPLVM -from warped_gp import WarpedGP -from bayesian_gplvm import BayesianGPLVM -from mrd import MRD -from gradient_checker import GradientChecker -from gp_multioutput_regression import GPMultioutputRegression -from sparse_gp_multioutput_regression import SparseGPMultioutputRegression +from gp_regression import GPRegression; _gp_regression = gp_regression ; del gp_regression +from gp_classification import GPClassification; _gp_classification = gp_classification ; del gp_classification +from sparse_gp_regression import SparseGPRegression; _sparse_gp_regression = sparse_gp_regression ; del sparse_gp_regression +from svigp_regression import SVIGPRegression; _svigp_regression = svigp_regression ; del svigp_regression +from sparse_gp_classification import SparseGPClassification; _sparse_gp_classification = sparse_gp_classification ; del sparse_gp_classification +from fitc_classification import FITCClassification; _fitc_classification = fitc_classification ; del fitc_classification +from gplvm import GPLVM; _gplvm = gplvm ; del gplvm +from bcgplvm import BCGPLVM; _bcgplvm = bcgplvm; del bcgplvm +from sparse_gplvm import SparseGPLVM; _sparse_gplvm = sparse_gplvm ; del sparse_gplvm +from warped_gp import WarpedGP; _warped_gp = warped_gp ; del warped_gp +from bayesian_gplvm import BayesianGPLVM; _bayesian_gplvm = bayesian_gplvm ; del bayesian_gplvm +from mrd import MRD; _mrd = mrd ; del mrd +from gradient_checker import GradientChecker; _gradient_checker = gradient_checker ; del gradient_checker +from gp_multioutput_regression import GPMultioutputRegression; _gp_multioutput_regression = gp_multioutput_regression ; del gp_multioutput_regression +from sparse_gp_multioutput_regression import SparseGPMultioutputRegression; _sparse_gp_multioutput_regression = sparse_gp_multioutput_regression ; del sparse_gp_multioutput_regression + From a074763eb69597ae22b0b5f7b284a96685d12ea2 Mon Sep 17 00:00:00 2001 From: Nicolo Fusi Date: Thu, 14 Nov 2013 12:28:26 -0800 Subject: [PATCH 2/3] fixed problem in warping --- GPy/util/warping_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPy/util/warping_functions.py b/GPy/util/warping_functions.py index e05f39af..35ad3b80 100644 --- a/GPy/util/warping_functions.py +++ b/GPy/util/warping_functions.py @@ -222,7 +222,7 @@ class TanhWarpingFunction_d(WarpingFunction): """ - mpsi = psi.coSpy() + mpsi = psi.copy() d = psi[-1] mpsi = mpsi[:self.num_parameters-1].reshape(self.n_terms, 3) From b845c0d634a48f9e11e13cb6a3329629e84e28fd Mon Sep 17 00:00:00 2001 From: mu Date: Mon, 18 Nov 2013 10:43:58 +0000 Subject: [PATCH 3/3] constructor and init for ODE_UY --- 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 392f43ba..1feec4df 100644 --- a/GPy/kern/constructors.py +++ b/GPy/kern/constructors.py @@ -588,3 +588,20 @@ def ODE_1(input_dim=1, varianceU=1., varianceY=1., lengthscaleU=None, lengthsc """ part = parts.ODE_1.ODE_1(input_dim, varianceU, varianceY, lengthscaleU, lengthscaleY) return kern(input_dim, [part]) + +def ODE_UY(input_dim=2, varianceU=1., varianceY=1., lengthscaleU=None, lengthscaleY=None): + """ + kernel resultiong from a first order ODE with OU driving GP + :param input_dim: the number of input dimension, has to be equal to one + :type input_dim: int + :param input_lengthU: the number of input U length + :param varianceU: variance of the driving GP + :type varianceU: float + :param varianceY: 'variance' of the transfer function + :type varianceY: float + :param lengthscaleY: 'lengthscale' of the transfer function + :type lengthscaleY: float + :rtype: kernel object + """ + part = parts.ODE_UY.ODE_UY(input_dim, varianceU, varianceY, lengthscaleU, lengthscaleY) + return kern(input_dim, [part]) \ No newline at end of file diff --git a/GPy/kern/parts/__init__.py b/GPy/kern/parts/__init__.py index 0a758f1e..3b020828 100644 --- a/GPy/kern/parts/__init__.py +++ b/GPy/kern/parts/__init__.py @@ -14,6 +14,7 @@ import Matern32 import Matern52 import mlp import ODE_1 +import ODE_UY import periodic_exponential import periodic_Matern32 import periodic_Matern52