# Path: examples/context.py



import matplotlib
import numpy as np
import scipy.stats
import matplotlib.pylab as plt
import pdb
from .context import aep, ep
matplotlib.use('Agg')
np.random.seed(42)


def plot_model_no_control(model, plot_title='', name_suffix=''):
    # plot function
    mx, vx = model.get_posterior_x()
    mins = np.min(mx, axis=0) - 0.5
    maxs = np.max(mx, axis=0) + 0.5
    nGrid = 50
    xspaced = np.linspace(mins[0], maxs[0], nGrid)
    yspaced = np.linspace(mins[1], maxs[1], nGrid)
    xx, yy = np.meshgrid(xspaced, yspaced)
    Xplot = np.vstack((xx.flatten(), yy.flatten())).T
    mf, vf = model.predict_f(Xplot)
    fig = plt.figure()
    plt.imshow((mf[:, 0]).reshape(*xx.shape),
               vmin=mf.min(), vmax=mf.max(), origin='lower',
               extent=[mins[0], maxs[0], mins[1], maxs[1]], aspect='auto')
    plt.colorbar()
    plt.contour(
        xx, yy, (mf[:, 0]).reshape(*xx.shape),
        colors='k', linewidths=2, zorder=100)
    zu = model.dyn_layer.zu
    plt.plot(zu[:, 0], zu[:, 1], 'wo', mew=0, ms=4)

# Path: examples/context.py



# Path: examples/gpssm_hodgkin_huxley.py
import matplotlib
import numpy as np
import scipy.stats
import matplotlib.pylab as plt
import pdb
from .context import aep, ep

matplotlib.use('Agg')
np.random.seed(42)


def plot_model_no_control(model, plot_title='', name_suffix=''):
    # plot function
    mx, vx = model.get_posterior_x()
    mins = np.min(mx, axis=0) - 0.5
    maxs = np.max(mx, axis=0) + 0.5
    nGrid = 50
    xspaced = np.linspace(mins[0], maxs[0], nGrid)
    yspaced = np.linspace(mins[1], maxs[1], nGrid)
    xx, yy = np.meshgrid(xspaced, yspaced)
    Xplot = np.vstack((xx.flatten(), yy.flatten())).T
    mf, vf = model.predict_f(Xplot)
    fig = plt.figure()
    plt.imshow((mf[:, 0]).reshape(*xx.shape),
               vmin=mf.min(), vmax=mf.max(), origin='lower',
               extent=[mins[0], maxs[0], mins[1], maxs[1]], aspect='auto')
    plt.colorbar()
    plt.contour(
        xx, yy, (mf[:, 0]).reshape(*xx.shape),
        colors='k', linewidths=2, zorder=100)
    zu = model.dyn_layer.zu
    plt.plot(zu[:, 0], zu[:, 1], 'wo', mew=0, ms=4)

    for i in range(mx.shape[0] - 1):