

def stick_bgplvm(model=None, optimize=True, verbose=True, plot=True):
    'Interactive visualisation of the Stick Man data from Ohio State University with the Bayesian GPLVM.'
    from GPy.models import BayesianGPLVM
    from matplotlib import pyplot as plt
    import numpy as np
    import GPy
    import pods
    data = pods.datasets.osu_run1()
    Q = 6
    kernel = GPy.kern.RBF(Q, lengthscale=np.repeat(0.5, Q), ARD=True)
    m = BayesianGPLVM(data['Y'], Q, init='PCA', num_inducing=20, kernel=kernel)
    m.data = data
    m.likelihood.variance = 0.001
    try:
        if optimize:
            m.optimize('bfgs', messages=verbose, max_iters=5000.0, bfgs_factor=10)
    except KeyboardInterrupt:
        print('Keyboard interrupt, continuing to plot and return')
    if plot:
        (fig, (latent_axes, sense_axes)) = plt.subplots(1, 2)
        plt.sca(latent_axes)
        m.plot_latent(ax=latent_axes)
        y = m.Y[:1, :].copy()
        data_show = GPy.plotting.matplot_dep.visualize.stick_show(y, connect=data['connect'])
        dim_select = GPy.plotting.matplot_dep.visualize.lvm_dimselect(m.X.mean[:1, :].copy(), m, data_show, latent_axes=latent_axes, sense_axes=sense_axes)
        fig.canvas.draw()
        raw_input('Press enter to finish')
    return fig

dataset/ETHPy150Open SheffieldML/GPy/GPy/examples/dimensionality_reduction.py stick_bgplvm/VarMisuse@304/452 `m`->`fig`