Пример #1
0
budget = 20
fnames = ['../cache/fith/EI{}.p'.format(i) for i in xrange(5)]
statesEI=search.multiMLEFS(ojf,lb,ub,kernel,1.,budget,fnames)


fnames = ['../cache/fith/PE{}.p'.format(i) for i in xrange(5)]
statesPE=search.multiPESFS(ojf,lb,ub,kernel,1.,budget,fnames)


kindex = GPdc.MAT52CS
prior = sp.array([0.]+[-1.]*(d+1)+[-2.])
sprior = sp.array([1.]*(d+2)+[2.])
kernel = [kindex,prior,sprior]

fnames = ["../cache/fith/PI{}.p".format(i) for i in xrange(5)]
statesPI = search.multiPESIPS(ojfa,lb,ub,kernel,10,fnames)


x=[]
y=[]
for stateEI in statesEI:
    a[2].plot(stateEI[11],'r')
    #a[3].plot([sum(stateEI[5][:i]) for i in xrange(len(stateEI[5]))],stateEI[11],'r')
    x.append([sum(stateEI[5][:i]) for i in xrange(len(stateEI[5]))])
    y.append(stateEI[11].flatten())
    print 'reccomended under EI: {} : {}'.format([10**i for i in stateEI[4][-1]],ojf(stateEI[4][-1],None,None)[0])
X_,Y_,lb_,ub_ = OPTutils.mergelines(x,y)
a[3].fill_between(X_,lb_,ub_,facecolor='lightcoral',edgecolor='lightcoral',alpha=0.5)
a[3].plot(X_,Y_,'r')

x=[]
Пример #2
0
ub = sp.array([[1] * d])

budget = 20
fnames = ['../cache/fith/EI{}.p'.format(i) for i in xrange(5)]
statesEI = search.multiMLEFS(ojf, lb, ub, kernel, 1., budget, fnames)

fnames = ['../cache/fith/PE{}.p'.format(i) for i in xrange(5)]
statesPE = search.multiPESFS(ojf, lb, ub, kernel, 1., budget, fnames)

kindex = GPdc.MAT52CS
prior = sp.array([0.] + [-1.] * (d + 1) + [-2.])
sprior = sp.array([1.] * (d + 2) + [2.])
kernel = [kindex, prior, sprior]

fnames = ["../cache/fith/PI{}.p".format(i) for i in xrange(5)]
statesPI = search.multiPESIPS(ojfa, lb, ub, kernel, 10, fnames)

x = []
y = []
for stateEI in statesEI:
    a[2].plot(stateEI[11], 'r')
    #a[3].plot([sum(stateEI[5][:i]) for i in xrange(len(stateEI[5]))],stateEI[11],'r')
    x.append([sum(stateEI[5][:i]) for i in xrange(len(stateEI[5]))])
    y.append(stateEI[11].flatten())
    print 'reccomended under EI: {} : {}'.format(
        [10**i for i in stateEI[4][-1]],
        ojf(stateEI[4][-1], None, None)[0])
X_, Y_, lb_, ub_ = OPTutils.mergelines(x, y)
a[3].fill_between(X_,
                  lb_,
                  ub_,
Пример #3
0
plane00 = planemin(0.)
plane025 = planemin(0.25)
plane05 = planemin(0.5)
plane001 = planemin(0.01)
plane10 = planemin(1.)
nreps=6
bd=35

kindex = GPdc.MAT52CS
prior = sp.array([0.]+[-1.]*(d+1)+[-2.])
sprior = sp.array([1.]*(d+2)+[2.])
kernel = [kindex,prior,sprior]

names = ["../cache/IPS_/PESIPS_"+str(dcc)+"_"+str(fls)+"_"+str(seed)+"_"+str(i)+".p" for i in xrange(nreps)]
results = search.multiPESIPS(ojf,lb,ub,kernel,bd,names)

f,a = plt.subplots(2)
aot = a[0].twinx()
Xa = [sp.array(r[0][:,0]) for r in results]
#Ca = [[sum(r[5][:j]) for j in xrange(len(r[5]))] for r in results]

x=[]
y=[]
w=[]

for r in results:
    #a[0].plot(r[0][:,0].flatten(),'b')
    
    #a[0].plot(r[5],'r')
    #a[1].plot((r[11].flatten()-ymin),'b')