From 5b25273d2b92a7c513f3705f58e9d5e2d2295b7f Mon Sep 17 00:00:00 2001 From: Alan Saul Date: Mon, 9 Sep 2013 17:44:08 +0100 Subject: [PATCH] Removed unneeded dependency --- GPy/examples/laplace_approximations.py | 24 ++++++++++++------------ GPy/likelihoods/Laplace.py | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/GPy/examples/laplace_approximations.py b/GPy/examples/laplace_approximations.py index 8be08a8f..b6443664 100644 --- a/GPy/examples/laplace_approximations.py +++ b/GPy/examples/laplace_approximations.py @@ -25,7 +25,7 @@ def timing(): edited_real_sd = real_sd kernel1 = GPy.kern.rbf(X.shape[1]) - t_distribution = GPy.likelihoods.likelihood_functions.student_t(deg_free, sigma2=edited_real_sd) + t_distribution = GPy.likelihoods.likelihood_functions.Student_t(deg_free, sigma2=edited_real_sd) corrupt_stu_t_likelihood = GPy.likelihoods.Laplace(Yc.copy(), t_distribution, opt='rasm') m = GPy.models.GP(X, corrupt_stu_t_likelihood, kernel1) m.ensure_default_constraints() @@ -54,7 +54,7 @@ def v_fail_test(): edited_real_sd = real_sd print "Clean student t, rasm" - t_distribution = GPy.likelihoods.likelihood_functions.student_t(deg_free, sigma2=edited_real_sd) + t_distribution = GPy.likelihoods.likelihood_functions.Student_t(deg_free, sigma2=edited_real_sd) stu_t_likelihood = GPy.likelihoods.Laplace(Y.copy(), t_distribution, opt='rasm') m = GPy.models.GP(X, stu_t_likelihood, kernel1) m.constrain_positive('') @@ -101,7 +101,7 @@ def student_t_obj_plane(): print mgp kernelst = kernelgp.copy() - t_distribution = GPy.likelihoods.likelihood_functions.student_t(deg_free, sigma2=(real_std**2)) + t_distribution = GPy.likelihoods.likelihood_functions.Student_t(deg_free, sigma2=(real_std**2)) stu_t_likelihood = GPy.likelihoods.Laplace(Y.copy(), t_distribution, opt='rasm') m = GPy.models.GP(X, stu_t_likelihood, kernelst) m.ensure_default_constraints() @@ -154,7 +154,7 @@ def student_t_f_check(): kernelst = kernelgp.copy() #kernelst += GPy.kern.bias(X.shape[1]) - t_distribution = GPy.likelihoods.likelihood_functions.student_t(deg_free, sigma2=0.05) + t_distribution = GPy.likelihoods.likelihood_functions.Student_t(deg_free, sigma2=0.05) stu_t_likelihood = GPy.likelihoods.Laplace(Y.copy(), t_distribution, opt='rasm') m = GPy.models.GP(X, stu_t_likelihood, kernelst) #m['rbf_v'] = mgp._get_params()[0] @@ -206,7 +206,7 @@ def student_t_fix_optimise_check(): kernelst = kernelgp.copy() real_stu_t_std2 = (real_std**2)*((deg_free - 2)/float(deg_free)) - t_distribution = GPy.likelihoods.likelihood_functions.student_t(deg_free, sigma2=real_stu_t_std2) + t_distribution = GPy.likelihoods.likelihood_functions.Student_t(deg_free, sigma2=real_stu_t_std2) stu_t_likelihood = GPy.likelihoods.Laplace(Y.copy(), t_distribution, opt='rasm') plt.figure(1) @@ -349,7 +349,7 @@ def debug_student_t_noise_approx(): #edited_real_sd = real_sd print "Clean student t, rasm" - t_distribution = GPy.likelihoods.likelihood_functions.student_t(deg_free, sigma2=edited_real_sd) + t_distribution = GPy.likelihoods.likelihood_functions.Student_t(deg_free, sigma2=edited_real_sd) stu_t_likelihood = GPy.likelihoods.Laplace(Y.copy(), t_distribution, opt='rasm') m = GPy.models.GP(X, stu_t_likelihood, kernel6) @@ -384,7 +384,7 @@ def debug_student_t_noise_approx(): return m #print "Clean student t, ncg" - #t_distribution = GPy.likelihoods.likelihood_functions.student_t(deg_free, sigma2=edited_real_sd) + #t_distribution = GPy.likelihoods.likelihood_functions.Student_t(deg_free, sigma2=edited_real_sd) #stu_t_likelihood = GPy.likelihoods.Laplace(Y, t_distribution, opt='ncg') #m = GPy.models.GP(X, stu_t_likelihood, kernel3) #m.ensure_default_constraints() @@ -480,7 +480,7 @@ def student_t_approx(): edited_real_sd = real_std #initial_var_guess print "Clean student t, rasm" - t_distribution = GPy.likelihoods.likelihood_functions.student_t(deg_free, sigma2=edited_real_sd) + t_distribution = GPy.likelihoods.likelihood_functions.Student_t(deg_free, sigma2=edited_real_sd) stu_t_likelihood = GPy.likelihoods.Laplace(Y.copy(), t_distribution, opt='rasm') m = GPy.models.GP(X, stu_t_likelihood, kernel6) m.ensure_default_constraints() @@ -496,7 +496,7 @@ def student_t_approx(): plt.title('Student-t rasm clean') print "Corrupt student t, rasm" - t_distribution = GPy.likelihoods.likelihood_functions.student_t(deg_free, sigma2=edited_real_sd) + t_distribution = GPy.likelihoods.likelihood_functions.Student_t(deg_free, sigma2=edited_real_sd) corrupt_stu_t_likelihood = GPy.likelihoods.Laplace(Yc.copy(), t_distribution, opt='rasm') m = GPy.models.GP(X, corrupt_stu_t_likelihood, kernel4) m.ensure_default_constraints() @@ -514,7 +514,7 @@ def student_t_approx(): return m #print "Clean student t, ncg" - #t_distribution = GPy.likelihoods.likelihood_functions.student_t(deg_free, sigma2=edited_real_sd) + #t_distribution = GPy.likelihoods.likelihood_functions.Student_t(deg_free, sigma2=edited_real_sd) #stu_t_likelihood = GPy.likelihoods.Laplace(Y, t_distribution, opt='ncg') #m = GPy.models.GP(X, stu_t_likelihood, kernel3) #m.ensure_default_constraints() @@ -528,7 +528,7 @@ def student_t_approx(): #plt.title('Student-t ncg clean') #print "Corrupt student t, ncg" - #t_distribution = GPy.likelihoods.likelihood_functions.student_t(deg_free, sigma2=edited_real_sd) + #t_distribution = GPy.likelihoods.likelihood_functions.Student_t(deg_free, sigma2=edited_real_sd) #corrupt_stu_t_likelihood = GPy.likelihoods.Laplace(Yc.copy(), t_distribution, opt='ncg') #m = GPy.models.GP(X, corrupt_stu_t_likelihood, kernel5) #m.ensure_default_constraints() @@ -612,7 +612,7 @@ def gaussian_f_check(): kernelg = kernelgp.copy() #kernelst += GPy.kern.bias(X.shape[1]) N, D = X.shape - g_distribution = GPy.likelihoods.likelihood_functions.gaussian(variance=0.1, N=N, D=D) + g_distribution = GPy.likelihoods.likelihood_functions.Gaussian(variance=0.1, N=N, D=D) g_likelihood = GPy.likelihoods.Laplace(Y.copy(), g_distribution, opt='rasm') m = GPy.models.GP(X, g_likelihood, kernelg) #m['rbf_v'] = mgp._get_params()[0] diff --git a/GPy/likelihoods/Laplace.py b/GPy/likelihoods/Laplace.py index 58304c23..b5b16521 100644 --- a/GPy/likelihoods/Laplace.py +++ b/GPy/likelihoods/Laplace.py @@ -4,7 +4,7 @@ import GPy from scipy.linalg import inv, cho_solve, det from numpy.linalg import cond from likelihood import likelihood -from ..util.linalg import pdinv, mdot, jitchol, chol_inv, det_ln_diag, pddet +from ..util.linalg import pdinv, mdot, jitchol, chol_inv, pddet from scipy.linalg.lapack import dtrtrs import random #import pylab as plt