from progapy.factories.json2gp import load_json, build_gp_from_json
from progapy.viewers.view_1d import view as view_this_gp


import pylab as pp
import numpy as np

problem_params = load_default_params()
problem = Problem( problem_params, force_init = True )

nbr_samples = 5000
#epsilon     = 0.5
epsilon = 0.1

filename = "./examples/exponential_problem/gp.json"
json_gp = load_json( filename )

gp = build_gp_from_json( json_gp ) 
pgp = ProductGaussianProcess( [gp] ) 
surrogate_params = {}
surrogate_params["gp"] = pgp

surrogate = Surrogate( surrogate_params )
response_model_params = {"surrogate":surrogate}
acquistion_params = {}
kernel_params = {}
#kernel_params["lower_epsilon"]               = -np.inf
#kernel_params["upper_epsilon"]               = epsilon
kernel_params["epsilon"]                     = epsilon

state_params = {}
Пример #2
0
print "RANDOM SEED"
np.random.seed(0)

nbr_samples = 2000
reject_epsilon = 3.0
n_reject = 50
nbr_thetas = 6
nbr_stats = 10

filename = "./examples/blowfly/gp.json"

gps = []
for gp_idx in range(nbr_stats):
    fn = "./examples/blowfly/p%dgp.json" % ((gp_idx + 1))
    json_gp = load_json(fn)
    #json_gp["kernel"]["type"]="squared_exponential"
    gp = build_gp_from_json(json_gp)
    gp.kernel.shrink_length_scales(0.5)
    #gp.precomputes()
    gps.append(gp)
pgp = ProductGaussianProcess(gps)
#assert False
surrogate_params = {}
surrogate_params["gp"] = pgp
surrogate_params["obs_statistics"] = state_params["obs_statistics"]
surrogate_params["epsilon"] = 0.0

rej_state_params = state_params.copy()
rej_state_params["S"] = 1
rej_state = RejectState(None, rej_state_params)
from progapy.gps.product_gaussian_process import ProductGaussianProcess
from progapy.factories.json2gp import load_json, build_gp_from_json
from progapy.viewers.view_1d import view as view_this_gp

import pylab as pp
import numpy as np

problem_params = load_default_params()
problem = Problem(problem_params, force_init=True)

nbr_samples = 5000
#epsilon     = 0.5
epsilon = 0.1

filename = "./examples/exponential_problem/gp.json"
json_gp = load_json(filename)

gp = build_gp_from_json(json_gp)
pgp = ProductGaussianProcess([gp])
surrogate_params = {}
surrogate_params["gp"] = pgp

surrogate = Surrogate(surrogate_params)
response_model_params = {"surrogate": surrogate}
acquistion_params = {}
kernel_params = {}
#kernel_params["lower_epsilon"]               = -np.inf
#kernel_params["upper_epsilon"]               = epsilon
kernel_params["epsilon"] = epsilon

state_params = {}
Пример #4
0
print "RANDOM SEED"
np.random.seed(0)

nbr_samples = 15000
reject_epsilon     = 3.0
n_reject           = 100
nbr_thetas         = 6
nbr_stats          = 10

filename = "./examples/blowfly/gp.json"

gps = []
for gp_idx in range( nbr_stats ):
  fn = "./examples/blowfly/p%dgp.json"%((gp_idx+1))
  #json_gp = load_json( filename )
  json_gp = load_json( fn )
  #json_gp["kernel"]["type"]="squared_exponential"
  gp = build_gp_from_json( json_gp ) 
  gps.append( gp )
pgp = ProductGaussianProcess( gps) 
#assert False
surrogate_params = {}
surrogate_params["gp"] = pgp
surrogate_params["epsilon"] = 0.5
surrogate_params["obs_statistics"]     = state_params["obs_statistics"]

rej_state_params = state_params.copy()
rej_state_params["S"] = 1
rej_state = RejectState(None, rej_state_params )
recorder = Recorder(record_stats=True)