From 4926a2f993dc3239f4ea6a498b33eadb2729dcc5 Mon Sep 17 00:00:00 2001 From: Vincenzo Lavorini Date: Mon, 15 Oct 2018 18:25:54 +0200 Subject: [PATCH 1/5] Added missing columns (:), fixed indentation --- GPy/models/state_space_cython.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GPy/models/state_space_cython.pyx b/GPy/models/state_space_cython.pyx index 2626b9e7..ddfce6f0 100644 --- a/GPy/models/state_space_cython.pyx +++ b/GPy/models/state_space_cython.pyx @@ -484,7 +484,7 @@ cdef class AQcompute_batch_Cython(Q_handling_Cython): if matrix_index in self.Q_square_root_dict: square_root = self.Q_square_root_dict[matrix_index] else: - if matrix_index not in self.Q_svd_dict + if matrix_index not in self.Q_svd_dict: U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index], full_matrices=False, compute_uv=True, overwrite_a=False, check_finite=False) @@ -514,7 +514,7 @@ cdef class AQcompute_batch_Cython(Q_handling_Cython): if matrix_index in self.Q_inverse_dict: Q_inverse = self.Q_inverse_dict[matrix_index] else: - if matrix_index not in self.Q_svd_dict + if matrix_index not in self.Q_svd_dict: U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index], full_matrices=False, compute_uv=True, overwrite_a=False, check_finite=False) @@ -522,7 +522,7 @@ cdef class AQcompute_batch_Cython(Q_handling_Cython): else: U,S,Vh = self.Q_svd_dict[matrix_index] - Q_inverse = Q_inverse = np.dot( Vh.T * ( 1.0/(S + jitter)) , U.T ) + Q_inverse = Q_inverse = np.dot( Vh.T * ( 1.0/(S + jitter)) , U.T ) self.Q_inverse_dict[matrix_index] = Q_inverse return Q_inverse @@ -998,4 +998,4 @@ def _cont_discr_kalman_filter_raw_Cython(int state_dim, Dynamic_Callables_Cython M[k+1,:,:] = m_upd # separate mean value for each time series P[k+1,:,:] = P_upd[0] - return (M, P, log_likelihood, grad_log_likelihood, p_dynamic_callables.reset(False)) \ No newline at end of file + return (M, P, log_likelihood, grad_log_likelihood, p_dynamic_callables.reset(False)) From a86723c8abc3a676e16b8be04ca49a34ec0b5f7e Mon Sep 17 00:00:00 2001 From: Zhenwen Dai Date: Tue, 30 Oct 2018 07:43:44 +0000 Subject: [PATCH 2/5] Fix the bug in the prediction of full covariance matrix (#702) * fix the bug in the prediction of full covariance matrix * Fix the test cases. * update the version requirement for matplotlib --- GPy/inference/latent_function_inference/posterior.py | 3 ++- GPy/plotting/matplot_dep/plot_definitions.py | 2 +- GPy/testing/model_tests.py | 2 +- setup.py | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/GPy/inference/latent_function_inference/posterior.py b/GPy/inference/latent_function_inference/posterior.py index 5dcf22ff..47f8c615 100644 --- a/GPy/inference/latent_function_inference/posterior.py +++ b/GPy/inference/latent_function_inference/posterior.py @@ -245,6 +245,7 @@ class Posterior(object): for i in range(var.shape[1]): var[:, i] = (Kxx - (np.sum(np.dot(woodbury_inv[:, :, i].T, Kx) * Kx, 0))) var = var + var = np.clip(var, 1e-15, np.inf) else: psi0_star = kern.psi0(pred_var, Xnew) psi1_star = kern.psi1(pred_var, Xnew) @@ -265,7 +266,7 @@ class Posterior(object): var += -psi2_star.reshape(N, -1).dot(woodbury_inv.flat)[:, None] else: var += -psi2_star.reshape(N, -1).dot(woodbury_inv.reshape(-1, D)) - var = np.clip(var, 1e-15, np.inf) + var = np.clip(var, 1e-15, np.inf) return mu, var diff --git a/GPy/plotting/matplot_dep/plot_definitions.py b/GPy/plotting/matplot_dep/plot_definitions.py index 290aa743..34f32ac5 100644 --- a/GPy/plotting/matplot_dep/plot_definitions.py +++ b/GPy/plotting/matplot_dep/plot_definitions.py @@ -122,7 +122,7 @@ class MatplotlibPlots(AbstractPlottingLibrary): def barplot(self, ax, x, height, width=0.8, bottom=0, color=Tango.colorsHex['mediumBlue'], label=None, **kwargs): if 'align' not in kwargs: kwargs['align'] = 'center' - return ax.bar(left=x, height=height, width=width, + return ax.bar(x=x, height=height, width=width, bottom=bottom, label=label, color=color, **kwargs) diff --git a/GPy/testing/model_tests.py b/GPy/testing/model_tests.py index 9187f209..adfbc837 100644 --- a/GPy/testing/model_tests.py +++ b/GPy/testing/model_tests.py @@ -238,7 +238,7 @@ class MiscTests(unittest.TestCase): # Not easy to check if woodbury_inv is correct in itself as it requires a large derivation and expression Kinv = m.posterior.woodbury_inv K_hat = k.K(self.X_new) - k.K(self.X_new, Z).dot(Kinv).dot(k.K(Z, self.X_new)) - K_hat = np.clip(K_hat, 1e-15, np.inf) + # K_hat = np.clip(K_hat, 1e-15, np.inf) mu, covar = m.predict_noiseless(self.X_new, full_cov=True) self.assertEquals(mu.shape, (self.N_new, self.D)) diff --git a/setup.py b/setup.py index ab7e85a0..5ab18557 100644 --- a/setup.py +++ b/setup.py @@ -164,7 +164,7 @@ setup(name = 'GPy', 'optional':['mpi4py', 'ipython>=4.0.0', ], - 'plotting':['matplotlib >= 1.3', + 'plotting':['matplotlib >= 3.0', 'plotly >= 1.8.6'], 'notebook':['jupyter_client >= 4.0.6', 'ipywidgets >= 4.0.3', @@ -185,7 +185,7 @@ setup(name = 'GPy', 'Intended Audience :: Developers', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries :: Python Modules', - + ] ) From ad3e90968c26466eb86eabb32a4bd75fe7b1cf81 Mon Sep 17 00:00:00 2001 From: Zhenwen Dai Date: Tue, 30 Oct 2018 10:05:56 +0000 Subject: [PATCH 3/5] Bump the version: 1.9.5 -> 1.9.6 --- CHANGELOG.md | 139 +++++++++++++++++++++++++-------------------- GPy/__version__.py | 2 +- 2 files changed, 79 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c18a81d7..7990ead2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## v1.9.6 (2018-10-30) + +## New + +* Added a new class that enables using multiple likelihoods [@esiivola] + +* Alex grig kalman new [@AlexGrig, @mzwiessele] + +## Fix + +* fix typo in docstring for GP.opimize() [@RobRomijnders] + +* Updates to posterior sampling [@lawrennd] + +* Jayanthkoushik cython fix [@jayanthkoushik, @mzwiessele] + +* Added missing columns (:), fixed indentation [@vlavorini] + +* Fix the bug in the prediction of full covariance matrix [@zhenwendai] ## v1.9.5 (2018-09-02) @@ -2484,8 +2503,8 @@ * Merge branch 'devel' into paramz. [mzwiessele] Conflicts: - GPy/core/parameterization/parameter_core.py - GPy/testing/pickle_tests.py + GPy/core/parameterization/parameter_core.py + GPy/testing/pickle_tests.py * [paramz] wrapping - todo: deprecation warnings. [mzwiessele] @@ -3998,7 +4017,7 @@ * Merge remote-tracking branch 'upstream/devel' into devel. [tjhgit] Conflicts: - GPy/kern/__init__.py + GPy/kern/__init__.py * Added spline kernel (from P. Hennig) to GPy. [tjhgit] @@ -5533,10 +5552,10 @@ * Integrated Laplace and merged Merge remote-tracking branch 'gpy_real/devel' into merge_branch. [Alan Saul] Conflicts: - GPy/core/gp.py - GPy/likelihoods/__init__.py - GPy/likelihoods/likelihood_functions.py - GPy/likelihoods/link_functions.py + GPy/core/gp.py + GPy/likelihoods/__init__.py + GPy/likelihoods/likelihood_functions.py + GPy/likelihoods/link_functions.py * Fixed white variance. [Alan Saul] @@ -5675,7 +5694,7 @@ * Merge branch 'devel' of github.com:SheffieldML/GPy into devel. [Max Zwiessele] Conflicts: - GPy/inference/latent_function_inference/inferenceX.py + GPy/inference/latent_function_inference/inferenceX.py * Merge branch 'devel' of github.com:SheffieldML/GPy into devel. [Zhenwen Dai] @@ -6190,7 +6209,7 @@ * [dim red plots] plotting big models. [mzwiessele] Conflicts: - GPy/plotting/matplot_dep/dim_reduction_plots.py + GPy/plotting/matplot_dep/dim_reduction_plots.py * Add debug util module and try to debug sparsegp_mpi. [Zhenwen Dai] @@ -6207,8 +6226,8 @@ * [normalizer] first commit for normalizer in GPy. [mzwiessele] Conflicts: - GPy/core/sparse_gp.py - GPy/models/bayesian_gplvm.py + GPy/core/sparse_gp.py + GPy/models/bayesian_gplvm.py * Further bug fix for sparsegp_mpi. [Zhenwen Dai] @@ -6227,8 +6246,8 @@ * [ard] enhanced ard handling and plotting. [mzwiessele] Conflicts: - GPy/kern/_src/linear.py - GPy/models/ss_gplvm.py + GPy/kern/_src/linear.py + GPy/models/ss_gplvm.py * [linear] einsums. [mzwiessele] @@ -6331,14 +6350,14 @@ * [inference] less constant jitter, and jitter adjustements. [mzwiessele] Conflicts: - GPy/util/linalg.py + GPy/util/linalg.py * Fixed a bug in optimize restarts: it now used optimizer_array. [James Hensman] * [vardtc missing] logging. [maxz] Conflicts: - GPy/inference/latent_function_inference/var_dtc.py + GPy/inference/latent_function_inference/var_dtc.py * [init] normalization bugfix. [mzwiessele] @@ -6839,7 +6858,7 @@ * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] Conflicts: - GPy/kern/_src/kern.py + GPy/kern/_src/kern.py * Missing file, import line commented. [Ricardo] @@ -6888,8 +6907,8 @@ * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] Conflicts: - GPy/models/gp_classification.py - GPy/models/sparse_gp_classification.py + GPy/models/gp_classification.py + GPy/models/sparse_gp_classification.py * New file. [Ricardo] @@ -7170,7 +7189,7 @@ * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] Conflicts: - GPy/likelihoods/mixed_noise.py + GPy/likelihoods/mixed_noise.py * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] @@ -7255,14 +7274,14 @@ * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Max Zwiessele] Conflicts: - GPy/likelihoods/gaussian.py + GPy/likelihoods/gaussian.py * Bug fix w.r.t. var_dtc.py. [Zhenwen Dai] * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] Conflicts: - GPy/inference/latent_function_inference/var_dtc.py + GPy/inference/latent_function_inference/var_dtc.py * New model SparseGPCoregionalizedRegression. [Ricardo] @@ -7462,8 +7481,8 @@ * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] Conflicts: - GPy/core/gp.py - GPy/plotting/matplot_dep/models_plots.py + GPy/core/gp.py + GPy/plotting/matplot_dep/models_plots.py * GPCoregionalizedRegresssion added. [Ricardo] @@ -7724,7 +7743,7 @@ * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] Conflicts: - GPy/kern/_src/constructors.py + GPy/kern/_src/constructors.py * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] @@ -7733,8 +7752,8 @@ * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] Conflicts: - GPy/kern/kern.py - GPy/kern/parts/prod.py + GPy/kern/kern.py + GPy/kern/parts/prod.py * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] @@ -7743,7 +7762,7 @@ * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] Conflicts: - GPy/kern/parts/prod.py + GPy/kern/parts/prod.py * Minor changes. [Ricardo] @@ -8106,7 +8125,7 @@ * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Max Zwiessele] Conflicts: - GPy/core/parameterization/param.py + GPy/core/parameterization/param.py * Fixed a couple of small params bugs. [Alan Saul] @@ -8121,9 +8140,9 @@ * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Max Zwiessele] Conflicts: - GPy/core/parameterization/param.py - GPy/core/parameterization/parameter_core.py - GPy/core/parameterization/parameterized.py + GPy/core/parameterization/param.py + GPy/core/parameterization/parameter_core.py + GPy/core/parameterization/parameterized.py * Stupid error, needed to actually USE the gradients in student t... Looks like s2 of rasm's may have an extra -? dW_df == -d2logpdf_df not just d2logpdf_df? [Alan Saul] @@ -8208,7 +8227,7 @@ * Merge branch 'params' of github.com:SheffieldML/GPy into params. [Ricardo] Conflicts: - GPy/core/sparse_gp.py + GPy/core/sparse_gp.py * Typo corrected. [Ricardo] @@ -8622,7 +8641,7 @@ * Merge branch 'devel' of github.com:SheffieldML/GPy into devel. [Ricardo] Conflicts: - GPy/examples/classification.py + GPy/examples/classification.py * Fixed a bug in Neil's otherwise tidy hetero kernel. [James Hensman] @@ -8691,8 +8710,8 @@ * Merge branch 'devel' into params. [Max Zwiessele] Conflicts: - GPy/core/transformations.py - GPy/kern/parts/kernpart.py + GPy/core/transformations.py + GPy/kern/parts/kernpart.py * Merge pull request #77 from jamesmcm/devel. [James McMurray] @@ -8751,10 +8770,10 @@ * Merge branch 'devel' of github.com:SheffieldML/GPy into devel. [Ricardo] Conflicts: - GPy/examples/regression.py - GPy/kern/constructors.py - GPy/testing/kernel_tests.py - GPy/util/multioutput.py + GPy/examples/regression.py + GPy/kern/constructors.py + GPy/testing/kernel_tests.py + GPy/util/multioutput.py * Other local changes. [Neil Lawrence] @@ -8779,15 +8798,15 @@ * Merge branch 'linK_functions2' into devel. [Ricardo] Conflicts: - GPy/core/gp.py - GPy/core/gp_base.py - GPy/core/sparse_gp.py - GPy/examples/regression.py - GPy/kern/constructors.py - GPy/kern/parts/coregionalise.py - GPy/models/__init__.py - GPy/models/sparse_gp_classification.py - GPy/util/__init__.py + GPy/core/gp.py + GPy/core/gp_base.py + GPy/core/sparse_gp.py + GPy/examples/regression.py + GPy/kern/constructors.py + GPy/kern/parts/coregionalise.py + GPy/models/__init__.py + GPy/models/sparse_gp_classification.py + GPy/util/__init__.py * Useless files deleted. [Ricardo] @@ -9460,7 +9479,7 @@ * Merge branch 'devel' of github.com:SheffieldML/GPy into devel. [Ricardo] Conflicts: - GPy/core/fitc.py + GPy/core/fitc.py * FITC example added. [Ricardo] @@ -9628,7 +9647,7 @@ * Merge branch 'devel' of https://github.com/SheffieldML/GPy into devel. [Neil Lawrence] Conflicts: - GPy/models/GPLVM.py + GPy/models/GPLVM.py * Remove copies (they are now in visualize code ...). [Neil Lawrence] @@ -9776,7 +9795,7 @@ * Merge branch 'devel' of github.com:SheffieldML/GPy into devel. [Ricardo] Conflicts: - GPy/models/GP.py + GPy/models/GP.py * Plot function got broken with last commit, this fixes it. [Ricardo] @@ -10118,7 +10137,7 @@ * Merge branch 'devel' of https://github.com/SheffieldML/GPy into devel. [Neil Lawrence] Conflicts: - GPy/examples/dimensionality_reduction.py + GPy/examples/dimensionality_reduction.py * Minor changes. [Neil Lawrence] @@ -10189,8 +10208,8 @@ * Merge branch 'devel' into new_constraints. [James Hensman] Conflicts: - GPy/core/model.py - GPy/core/parameterised.py + GPy/core/model.py + GPy/core/parameterised.py * Merge branch 'devel' of github.com:SheffieldML/GPy into devel. [Max Zwiessele] @@ -10752,7 +10771,7 @@ * Merge branch 'master' of github.com:SheffieldML/GPy. [Ricardo Andrade] Conflicts: - GPy/examples/__init__.py + GPy/examples/__init__.py * Working on psi cross terms. [Nicolo Fusi] @@ -11192,7 +11211,7 @@ * Merge branch 'newGP' [James Hensman] Conflicts: - GPy/models/GP_regression.py + GPy/models/GP_regression.py * Simplified the checkgrad logic somewhat. [James Hensman] @@ -11223,7 +11242,7 @@ * Merge branch 'newGP' of github.com:SheffieldML/GPy into newGP. [James Hensman] Conflicts: - GPy/likelihoods/EP.py + GPy/likelihoods/EP.py * James' debugging of the EP/GP interface. [Ricardo Andrade] @@ -11234,8 +11253,8 @@ * Merge branch 'newGP' of github.com:SheffieldML/GPy into newGP. [Ricardo Andrade] Conflicts: - GPy/likelihoods/EP.py - GPy/likelihoods/likelihood_functions.py + GPy/likelihoods/EP.py + GPy/likelihoods/likelihood_functions.py * So many changes. [Ricardo Andrade] @@ -11999,5 +12018,3 @@ * Core file. [Nicolo Fusi] * Initial commit. [Nicolò Fusi] - - diff --git a/GPy/__version__.py b/GPy/__version__.py index 96974ae1..58bdec10 100644 --- a/GPy/__version__.py +++ b/GPy/__version__.py @@ -1 +1 @@ -__version__ = "1.9.5" +__version__ = "1.9.6" From ea705d43f0a436b3931c7d1af7559619352b3458 Mon Sep 17 00:00:00 2001 From: Dai Date: Wed, 31 Oct 2018 10:36:55 +0000 Subject: [PATCH 4/5] fix the version number in setup.cfg --- setup.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 97aa7a38..bee1179c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.9.5 +current_version = 1.9.6 tag = True commit = True @@ -12,4 +12,3 @@ upload-dir = doc/build/html [medatdata] description-file = README.rst - From b503c7184244f18c8462bda1b66a5011d61db297 Mon Sep 17 00:00:00 2001 From: Zhenwen Dai Date: Wed, 31 Oct 2018 10:39:45 +0000 Subject: [PATCH 5/5] fix the version number in appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 9530ebbe..e1b6013c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ environment: secure: 8/ZjXFwtd1S7ixd7PJOpptupKKEDhm2da/q3unabJ00= COVERALLS_REPO_TOKEN: secure: d3Luic/ESkGaWnZrvWZTKrzO+xaVwJWaRCEP0F+K/9DQGPSRZsJ/Du5g3s4XF+tS - gpy_version: 1.9.5 + gpy_version: 1.9.6 matrix: - PYTHON_VERSION: 2.7 MINICONDA: C:\Miniconda-x64