# Path: tests/context.py

# 
# Path: tests/context.py

# 
# Path: tests/context.py



import numpy as np
import copy
import pdb
import os
import time
import matplotlib
import matplotlib.pylab as plt
from scipy.optimize import check_grad
from .context import vfe, aep
from .context import flatten_dict, unflatten_dict
from .context import PROP_MC, PROP_MM
matplotlib.use('Agg')


np.random.seed(0)

def test_gpr_gaussian(nat_param=True):
    N_train = 20
    alpha = 0.000001
    M = 10
    D = 2
    Q = 3
    y_train = np.random.randn(N_train, Q)
    x_train = np.random.randn(N_train, D)
    model_vfe = vfe.SGPR(x_train, y_train, M, lik='Gaussian', nat_param=nat_param)
    params = model_vfe.init_hypers(y_train)
    params = model_vfe.optimise(method='adam', maxiter=2000)
    logZ_vfe, _ = model_vfe.objective_function(params, N_train)


# Path: tests/context.py

# 
# Path: tests/context.py

# 
# Path: tests/context.py



# Path: tests/test_aep_vfe_limits.py
import numpy as np
import copy
import pdb
import os
import time
import matplotlib
import matplotlib.pylab as plt
from scipy.optimize import check_grad
from .context import vfe, aep
from .context import flatten_dict, unflatten_dict
from .context import PROP_MC, PROP_MM

matplotlib.use('Agg')


np.random.seed(0)

def test_gpr_gaussian(nat_param=True):
    N_train = 20
    alpha = 0.000001
    M = 10
    D = 2
    Q = 3
    y_train = np.random.randn(N_train, Q)
    x_train = np.random.randn(N_train, D)
    model_vfe = vfe.SGPR(x_train, y_train, M, lik='Gaussian', nat_param=nat_param)
    params = model_vfe.init_hypers(y_train)
    params = model_vfe.optimise(method='adam', maxiter=2000)
    logZ_vfe, _ = model_vfe.objective_function(params, N_train)


    model_aep = aep.SGPR(x_train, y_train, M, lik='Gaussian', nat_param=nat_param)