Пример #1
0

braninmin = 0.
kindex = GPdc.MAT52
prior = sp.array([0.]+[-1.]*d)
sprior = sp.array([1.]*(d+1))
kernel = [kindex,prior,sprior]
nreps = 2
bd = 4*60
slist = [1e-9]
print 'start'
f,a = plt.subplots(3)
import os

for s in slist:
    
    names = ["../cache/mnist/EIMLE_5mnist"+str(int(100*sp.log10(s)))+"_"+"_"+str(i)+".p" for i in xrange(nreps)]
    results = search.multiMLEFS(ojf,lb,ub,kernel,s,bd,names)
    yr = [r[11].flatten() for r in results]
    C = [r[5] for r in results]
    
for i in xrange(nreps):
    m = yr[i]
    a[2].plot([sum(C[i][:j]) for j in xrange(len(C[i]))],m.flatten(),'x-')
    a[1].plot(C[i],'r')


print "reccomend: "+str([r[4][-1,:] for r in results])

f.savefig("../figs/braninnoise.png")
plt.show()
Пример #2
0
pwr = 0.2
cfn = lambda s:((1e-6)/s)**pwr
ojf = OPTutils.genbanana(cfn=cfn)
kindex = GPdc.MAT52
prior = sp.array([0.]+[-1.]*d)
sprior = sp.array([1.]*(d+1))
kernel = [kindex,prior,sprior]
nreps = 5
bd = 15
slist = [1e-4,1e-6,1e-8]
f,a = plt.subplots(2)

for s in slist:
    
    names = ["../cache/rosennoise/EIMLE_"+str(int(100*sp.log10(s)))+"_"+str(pwr)+"_"+str(i)+".p" for i in xrange(nreps)]
    results = search.multiMLEFS(ojf,lb,ub,kernel,s,bd,names)
    yr = [r[11].flatten() for r in results]
    C = results[0][5]
    
    names = ["../cache/rosennoise/PESFS_"+str(int(100*sp.log10(s)))+"_"+str(pwr)+"_"+str(i)+".p" for i in xrange(nreps)]
    results = search.multiPESFS(ojf,lb,ub,kernel,s,bd,names)
    zr = [r[11].flatten() for r in results]
    C = results[0][5]
        
    Z = sp.vstack(yr)
    m = sp.mean(sp.log10(Z),axis=0)
    v = sp.var(sp.log10(Z),axis=0)
    
    sq = sp.sqrt(v)
    
    a[1].fill_between(sp.array([sum(C[:j]) for j in xrange(len(C))]),(m-sq).flatten(),(m+sq).flatten(),facecolor='lightblue',edgecolor='lightblue',alpha=0.5)
Пример #3
0

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

#lets start with EI

lb = sp.array([[-1] * d])
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:
Пример #4
0

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

#lets start with EI

lb = sp.array([[-1]*d])
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)