mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-08 03:22:38 +02:00
bugfix: lineplot in visualize
This commit is contained in:
parent
7ea146d4a7
commit
debaf8315d
2 changed files with 5 additions and 5 deletions
|
|
@ -176,7 +176,7 @@ def bgplvm_oil(optimize=True, verbose=1, plot=True, N=200, Q=7, num_inducing=40,
|
||||||
if plot:
|
if plot:
|
||||||
y = m.Y
|
y = m.Y
|
||||||
fig, (latent_axes, sense_axes) = plt.subplots(1, 2)
|
fig, (latent_axes, sense_axes) = plt.subplots(1, 2)
|
||||||
m.plot_latent(ax=latent_axes)
|
m.plot_latent(ax=latent_axes, labels=m.data_labels)
|
||||||
data_show = GPy.plotting.matplot_dep.visualize.vector_show(y)
|
data_show = GPy.plotting.matplot_dep.visualize.vector_show(y)
|
||||||
lvm_visualizer = GPy.plotting.matplot_dep.visualize.lvm_dimselect(param_to_array(m.X.mean), # @UnusedVariable
|
lvm_visualizer = GPy.plotting.matplot_dep.visualize.lvm_dimselect(param_to_array(m.X.mean), # @UnusedVariable
|
||||||
m, data_show, latent_axes=latent_axes, sense_axes=sense_axes)
|
m, data_show, latent_axes=latent_axes, sense_axes=sense_axes)
|
||||||
|
|
|
||||||
|
|
@ -131,10 +131,10 @@ class lvm(matplotlib_show):
|
||||||
|
|
||||||
def modify(self, vals):
|
def modify(self, vals):
|
||||||
"""When latent values are modified update the latent representation and ulso update the output visualization."""
|
"""When latent values are modified update the latent representation and ulso update the output visualization."""
|
||||||
self.vals = vals[None,:].copy()
|
self.vals = vals.copy()
|
||||||
y = self.model.predict(self.vals)[0]
|
y = self.model.predict(self.vals)[0]
|
||||||
self.data_visualize.modify(y)
|
self.data_visualize.modify(y)
|
||||||
self.latent_handle.set_data(self.vals[:,self.latent_index[0]], self.vals[:,self.latent_index[1]])
|
self.latent_handle.set_data(self.vals[0,self.latent_index[0]], self.vals[0,self.latent_index[1]])
|
||||||
self.axes.figure.canvas.draw()
|
self.axes.figure.canvas.draw()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -153,8 +153,8 @@ class lvm(matplotlib_show):
|
||||||
if event.inaxes!=self.latent_axes: return
|
if event.inaxes!=self.latent_axes: return
|
||||||
if self.called and self.move_on:
|
if self.called and self.move_on:
|
||||||
# Call modify code on move
|
# Call modify code on move
|
||||||
self.latent_values[self.latent_index[0]]=event.xdata
|
self.latent_values[:, self.latent_index[0]]=event.xdata
|
||||||
self.latent_values[self.latent_index[1]]=event.ydata
|
self.latent_values[:, self.latent_index[1]]=event.ydata
|
||||||
self.modify(self.latent_values)
|
self.modify(self.latent_values)
|
||||||
|
|
||||||
def show_sensitivities(self):
|
def show_sensitivities(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue