mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-11 04:52:37 +02:00
Merge branch 'devel' of github.com:SheffieldML/GPy into devel
This commit is contained in:
commit
903c8bb123
4 changed files with 24 additions and 20 deletions
|
|
@ -138,6 +138,9 @@ def BGPLVM_oil(optimize=True, N=200, Q=10, num_inducing=15, max_f_eval=4e3, plot
|
||||||
|
|
||||||
# optimize
|
# optimize
|
||||||
if optimize:
|
if optimize:
|
||||||
|
m.constrain_fixed('noise')
|
||||||
|
m.optimize('scg', messages=1, max_f_eval=100, gtol=.05)
|
||||||
|
m.constrain_positive('noise')
|
||||||
m.optimize('scg', messages=1, max_f_eval=max_f_eval, gtol=.05)
|
m.optimize('scg', messages=1, max_f_eval=max_f_eval, gtol=.05)
|
||||||
|
|
||||||
if plot:
|
if plot:
|
||||||
|
|
@ -295,7 +298,7 @@ def mrd_simulation(optimize=True, plot=True, plot_sim=True, **kw):
|
||||||
|
|
||||||
if optimize:
|
if optimize:
|
||||||
print "Optimizing Model:"
|
print "Optimizing Model:"
|
||||||
m.optimize('scg', messages=1, max_iters=5e4, max_f_eval=5e4, gtol=.05)
|
m.optimize('scg', messages=1, max_iters=1e3, max_f_eval=1e3, gtol=.1)
|
||||||
if plot:
|
if plot:
|
||||||
m.plot_X_1d("MRD Latent Space 1D")
|
m.plot_X_1d("MRD Latent Space 1D")
|
||||||
m.plot_scales("MRD Scales")
|
m.plot_scales("MRD Scales")
|
||||||
|
|
|
||||||
|
|
@ -115,24 +115,25 @@ def tuto_kernel_overview():
|
||||||
|
|
||||||
# Create GP regression model
|
# Create GP regression model
|
||||||
m = GPy.models.GPRegression(X, Y, Kanova)
|
m = GPy.models.GPRegression(X, Y, Kanova)
|
||||||
pb.figure(figsize=(5,5))
|
fig = pb.figure(figsize=(5,5))
|
||||||
m.plot()
|
ax = fig.add_subplot(111)
|
||||||
|
m.plot(ax=ax)
|
||||||
|
|
||||||
pb.figure(figsize=(20,3))
|
pb.figure(figsize=(20,3))
|
||||||
pb.subplots_adjust(wspace=0.5)
|
pb.subplots_adjust(wspace=0.5)
|
||||||
pb.subplot(1,5,1)
|
axs = pb.subplot(1,5,1)
|
||||||
m.plot()
|
m.plot(ax=axs)
|
||||||
pb.subplot(1,5,2)
|
pb.subplot(1,5,2)
|
||||||
pb.ylabel("= ",rotation='horizontal',fontsize='30')
|
pb.ylabel("= ",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,3)
|
axs = pb.subplot(1,5,3)
|
||||||
m.plot(which_parts=[False,True,False,False])
|
m.plot(ax=axs, which_parts=[False,True,False,False])
|
||||||
pb.ylabel("cst +",rotation='horizontal',fontsize='30')
|
pb.ylabel("cst +",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,4)
|
axs = pb.subplot(1,5,4)
|
||||||
m.plot(which_parts=[False,False,True,False])
|
m.plot(ax=axs, which_parts=[False,False,True,False])
|
||||||
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,5)
|
axs = pb.subplot(1,5,5)
|
||||||
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
||||||
m.plot(which_parts=[False,False,False,True])
|
m.plot(ax=axs, which_parts=[False,False,False,True])
|
||||||
|
|
||||||
return(m)
|
return(m)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ class MRD(Model):
|
||||||
self.NQ = self.num_data * self.input_dim
|
self.NQ = self.num_data * self.input_dim
|
||||||
self.MQ = self.num_inducing * self.input_dim
|
self.MQ = self.num_inducing * self.input_dim
|
||||||
|
|
||||||
model.__init__(self) # @UndefinedVariable
|
super(MRD, self).__init__()
|
||||||
self._set_params(self._get_params())
|
self._set_params(self._get_params())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
||||||
|
|
@ -230,19 +230,19 @@ The submodels can be represented with the option ``which_function`` of ``plot``:
|
||||||
|
|
||||||
pb.figure(figsize=(20,3))
|
pb.figure(figsize=(20,3))
|
||||||
pb.subplots_adjust(wspace=0.5)
|
pb.subplots_adjust(wspace=0.5)
|
||||||
pb.subplot(1,5,1)
|
axs = pb.subplot(1,5,1)
|
||||||
m.plot()
|
m.plot(ax=axs)
|
||||||
pb.subplot(1,5,2)
|
pb.subplot(1,5,2)
|
||||||
pb.ylabel("= ",rotation='horizontal',fontsize='30')
|
pb.ylabel("= ",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,3)
|
axs = pb.subplot(1,5,3)
|
||||||
m.plot(which_parts=[False,True,False,False])
|
m.plot(ax=axs, which_parts=[False,True,False,False])
|
||||||
pb.ylabel("cst +",rotation='horizontal',fontsize='30')
|
pb.ylabel("cst +",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,4)
|
axs = pb.subplot(1,5,4)
|
||||||
m.plot(which_parts=[False,False,True,False])
|
m.plot(ax=axs, which_parts=[False,False,True,False])
|
||||||
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
||||||
pb.subplot(1,5,5)
|
axs = pb.subplot(1,5,5)
|
||||||
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
pb.ylabel("+ ",rotation='horizontal',fontsize='30')
|
||||||
m.plot(which_parts=[False,False,False,True])
|
m.plot(ax=axs, which_parts=[False,False,False,True])
|
||||||
|
|
||||||
.. pb.savefig('tuto_kern_overview_mANOVAdec.png',bbox_inches='tight')
|
.. pb.savefig('tuto_kern_overview_mANOVAdec.png',bbox_inches='tight')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue