mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-27 14:25:16 +02:00
[testing] BGPLVM
This commit is contained in:
parent
a6ad9c33a6
commit
133a815950
5 changed files with 33 additions and 19 deletions
|
|
@ -41,9 +41,7 @@ if config.get('plotting', 'library') is not 'none':
|
|||
from ..core import SparseGP
|
||||
SparseGP.plot_inducing = gpy_plot.data_plots.plot_inducing
|
||||
|
||||
from ..models import GPLVM
|
||||
from ..models import BayesianGPLVM
|
||||
from ..models import bayesian_gplvm_minibatch
|
||||
from ..models import GPLVM, BayesianGPLVM, bayesian_gplvm_minibatch, SSGPLVM, SSMRD
|
||||
GPLVM.plot_prediction_fit = gpy_plot.latent_plots.plot_prediction_fit
|
||||
GPLVM.plot_latent = gpy_plot.latent_plots.plot_latent
|
||||
GPLVM.plot_steepest_gradient_map = gpy_plot.latent_plots.plot_steepest_gradient_map
|
||||
|
|
@ -53,6 +51,9 @@ if config.get('plotting', 'library') is not 'none':
|
|||
bayesian_gplvm_minibatch.BayesianGPLVMMiniBatch.plot_latent = gpy_plot.latent_plots.plot_latent
|
||||
bayesian_gplvm_minibatch.BayesianGPLVMMiniBatch.plot_prediction_fit = gpy_plot.latent_plots.plot_prediction_fit
|
||||
bayesian_gplvm_minibatch.BayesianGPLVMMiniBatch.plot_steepest_gradient_map = gpy_plot.latent_plots.plot_steepest_gradient_map
|
||||
SSGPLVM.plot_latent = gpy_plot.latent_plots.plot_latent
|
||||
SSGPLVM.plot_prediction_fit = gpy_plot.latent_plots.plot_prediction_fit
|
||||
SSGPLVM.plot_steepest_gradient_map = gpy_plot.latent_plots.plot_steepest_gradient_map
|
||||
|
||||
from ..kern import Kern
|
||||
Kern.plot_covariance = gpy_plot.kernel_plots.plot_covariance
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ def plot_prediction_fit(self, plot_limits=None,
|
|||
:param dict sactter_kwargs: kwargs for the scatter plot, specific for the plotting library you are using
|
||||
:param kwargs plot_kwargs: kwargs for the data plot for the plotting library you are using
|
||||
"""
|
||||
canvas, kwargs = pl.get_new_canvas(plot_kwargs)
|
||||
canvas, kwargs = pl.get_new_canvas(**plot_kwargs)
|
||||
plots = _plot_prediction_fit(self, canvas, plot_limits, which_data_rows, which_data_ycols,
|
||||
fixed_inputs, resolution, plot_raw,
|
||||
apply_link, visible_dims,
|
||||
|
|
@ -289,9 +289,10 @@ def _plot_steepest_gradient_map(self, canvas, input_1, input_2, Xgrid,
|
|||
Y, annotation = plot_function(Xgrid[:, [input_1, input_2]])
|
||||
annotation_kwargs = update_not_existing_kwargs(annotation_kwargs or {}, pl.defaults.annotation)
|
||||
imshow_kwargs = update_not_existing_kwargs(imshow_kwargs or {}, pl.defaults.gradient)
|
||||
imshow, annotation = pl.annotation_heatmap(canvas, Y, annotation, (xmin[0], xmax[0], xmin[1], xmax[1]),
|
||||
None, plot_function, resolution, imshow_kwargs=imshow_kwargs, **annotation_kwargs)
|
||||
imshow_kwargs = update_not_existing_kwargs(imshow_kwargs, pl.defaults.gradient)
|
||||
imshow, annotation = pl.annotation_heatmap(canvas, Y, annotation,
|
||||
(xmin[0], xmax[0], xmin[1], xmax[1]),
|
||||
None, plot_function, resolution,
|
||||
imshow_kwargs=imshow_kwargs, **annotation_kwargs)
|
||||
return dict(heatmap=imshow, annotation=annotation)
|
||||
|
||||
def plot_steepest_gradient_map(self, output_labels=None, data_labels=None, which_indices=None,
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class MatplotlibPlots(AbstractPlottingLibrary):
|
|||
fontdict=dict(family='sans-serif', weight='light', size=9)
|
||||
if legend >= 1:
|
||||
#ax.legend(prop=fontdict)
|
||||
legend_ontop(ax, ncol=legend)
|
||||
legend_ontop(ax, ncol=legend, fontdict=fontdict)
|
||||
if zlim is not None:
|
||||
ax.set_zlim(zlim)
|
||||
ax.figure.canvas.draw()
|
||||
|
|
@ -144,7 +144,7 @@ class MatplotlibPlots(AbstractPlottingLibrary):
|
|||
annotations = []
|
||||
for [i, x], [j, y] in itertools.product(enumerate(xlin), enumerate(ylin[::-1])):
|
||||
annotations.append(ax.text(x + xoffset, y + yoffset, "{}".format(annotation[j, i]), **annotation_kwargs))
|
||||
return [imshow, annotations]
|
||||
return imshow, annotations
|
||||
|
||||
def contour(self, ax, X, Y, C, levels=20, label=None, **kwargs):
|
||||
return ax.contour(X, Y, C, levels=np.linspace(C.min(), C.max(), levels), label=label, **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue