# Path: examples/context.py



import numpy as np
import pdb
import matplotlib.pylab as plt
    import GPy
from .context import aep, ep
from scipy import special
    from operator import xor
    from scipy import special

np.random.seed(42)


def run_cluster():
    # create dataset
    print "creating dataset..."
    N = 50
    k1 = GPy.kern.RBF(5, variance=1, lengthscale=1. /
                      np.random.dirichlet(np.r_[10, 10, 10, 0.1, 0.1]), ARD=True)
    k2 = GPy.kern.RBF(5, variance=1, lengthscale=1. /
                      np.random.dirichlet(np.r_[10, 0.1, 10, 0.1, 10]), ARD=True)
    k3 = GPy.kern.RBF(5, variance=1, lengthscale=1. /
                      np.random.dirichlet(np.r_[0.1, 0.1, 10, 10, 10]), ARD=True)
    X = np.random.normal(0, 1, (N, 5))
    A = np.random.multivariate_normal(np.zeros(N), k1.K(X), 10).T
    B = np.random.multivariate_normal(np.zeros(N), k2.K(X), 10).T
    C = np.random.multivariate_normal(np.zeros(N), k3.K(X), 10).T

    Y = np.vstack((A, B, C))
    labels = np.hstack((np.zeros(A.shape[0]), np.ones(
        B.shape[0]), np.ones(C.shape[0]) * 2))

    # inference
    print "inference ..."
    M = 20
    D = 5
    lvm_aep = aep.SGPLVM(Y, D, M, lik='Gaussian')
    lvm_aep.optimise(method='L-BFGS-B', alpha=0.1, maxiter=2000)


# Path: examples/context.py



# Path: examples/gplvm_ep_examples.py
import numpy as np
import pdb
import matplotlib.pylab as plt
    import GPy
from .context import aep, ep
from scipy import special
    from operator import xor
    from scipy import special


np.random.seed(42)


def run_cluster():
    # create dataset
    print "creating dataset..."
    N = 50
    k1 = GPy.kern.RBF(5, variance=1, lengthscale=1. /
                      np.random.dirichlet(np.r_[10, 10, 10, 0.1, 0.1]), ARD=True)
    k2 = GPy.kern.RBF(5, variance=1, lengthscale=1. /
                      np.random.dirichlet(np.r_[10, 0.1, 10, 0.1, 10]), ARD=True)
    k3 = GPy.kern.RBF(5, variance=1, lengthscale=1. /
                      np.random.dirichlet(np.r_[0.1, 0.1, 10, 10, 10]), ARD=True)
    X = np.random.normal(0, 1, (N, 5))
    A = np.random.multivariate_normal(np.zeros(N), k1.K(X), 10).T
    B = np.random.multivariate_normal(np.zeros(N), k2.K(X), 10).T
    C = np.random.multivariate_normal(np.zeros(N), k3.K(X), 10).T

    Y = np.vstack((A, B, C))
    labels = np.hstack((np.zeros(A.shape[0]), np.ones(
        B.shape[0]), np.ones(C.shape[0]) * 2))

    # inference
    print "inference ..."
    M = 20
    D = 5
    lvm_aep = aep.SGPLVM(Y, D, M, lik='Gaussian')
    lvm_aep.optimise(method='L-BFGS-B', alpha=0.1, maxiter=2000)


    lvm = ep.SGPLVM(Y, D, M, lik='Gaussian')