コード例 #1
0
ファイル: testoptimize.py プロジェクト: markm541374/GPc

try:
    os.mkdir("test")
except OSError:
    pass
path = os.path.join(os.getcwd(), "test")

aqfn, aqpara = acquisitions.PESbs
# aqfn,aqpara = acquisitions.EIMAP
aqpara["lb"] = [-1.0, -1.0]
aqpara["ub"] = [1.0, 1.0]
aqpara["ev"]["s"] = 1e-12
cfn = objectives.cfaexp(1.0, 0.2)
ojf, xmin, ymin = objectives.genbiasedmat52ojf(len(aqpara["lb"]), aqpara["lb"], aqpara["ub"], 1.0)
ojfn = objectives.costfnwrap(ojf, cfn)
ojfchar = {"dx": len(aqpara["lb"]), "dev": len(aqpara["ev"])}
aqpara["cfn"] = cfn
aqpara["xau"] = 1.0
aqpara["xal"] = 0.0


# cfn = objectives.cf42
# ojfn,xmin,ymin = objectives.genmat52ojf(len(aqpara['lb']),aqpara['lb'],aqpara['ub'])
# ojfchar = {'dx':len(aqpara['lb']),'dev':len(aqpara['ev'])}


stoppara = {"nmax": 20}
stopfn = optimize.nstopfn

コード例 #2
0
ファイル: PESbssh.py プロジェクト: markm541374/GPc
aqpara['traincfn'] = True

stoppara = {'nmax': 100}
stopfn = optimize.nstopfn

reccfn, reccpara = reccomenders.gpasmap
reccpara['lb'] = aqpara['lb']
reccpara['ub'] = aqpara['ub']
reccpara['everyn'] = 1
reccpara['onlyafter'] = aqpara['nrandinit']

ojfw, xmin, ymin = objectives.genbiasedmat52ojf(len(aqpara['lb']),
                                                aqpara['lb'], aqpara['ub'],
                                                0.5)
ojf = objectives.costfnwrap(ojfw, cfn)
if True:
    from matplotlib import pyplot as plt
    import time
    n = 100
    x_ = sp.linspace(-1, 1, n)
    y_ = sp.linspace(-1, 1, n)
    z_ = sp.empty([n, n])
    s_ = sp.empty([n, n])
    for i in xrange(n):
        for j in xrange(n):
            m_ = ojfw(sp.array([y_[j], x_[i]]), **{
                's': 1e-9,
                'xa': 0.,
                'd': [sp.NaN]
            })
コード例 #3
0
ファイル: PESbssh.py プロジェクト: markm541374/GPc
aqpara['traincfn'] = True

stoppara= {'nmax':100}
stopfn = optimize.nstopfn

reccfn,reccpara = reccomenders.gpasmap
reccpara['lb']=aqpara['lb']
reccpara['ub']=aqpara['ub']
reccpara['everyn']=1
reccpara['onlyafter']=aqpara['nrandinit']



ojfw,xmin,ymin = objectives.genbiasedmat52ojf(len(aqpara['lb']),aqpara['lb'],aqpara['ub'],0.5)
ojf = objectives.costfnwrap(ojfw,cfn)
if True:
    from matplotlib import pyplot as plt
    import time
    n = 100
    x_ = sp.linspace(-1,1,n)
    y_ = sp.linspace(-1,1,n)
    z_ = sp.empty([n,n])
    s_ = sp.empty([n,n])
    for i in xrange(n):
        for j in xrange(n):
            m_= ojfw(sp.array([y_[j],x_[i]]),**{'s':1e-9,'xa':0.,'d':[sp.NaN]})
            z_[i,j] = m_[0]

    fig, ax = plt.subplots( nrows=1, ncols=1 ,figsize=(10,10))
    CS = ax.contour(x_,y_,z_,30)
コード例 #4
0
ファイル: testoptimize.py プロジェクト: markm541374/GPc
try:
    os.mkdir('test')
except OSError:
    pass
path = os.path.join(os.getcwd(), 'test')

aqfn, aqpara = acquisitions.PESbs
#aqfn,aqpara = acquisitions.EIMAP
aqpara['lb'] = [-1., -1.]
aqpara['ub'] = [1., 1.]
aqpara['ev']['s'] = 1e-12
cfn = objectives.cfaexp(1., 0.2)
ojf, xmin, ymin = objectives.genbiasedmat52ojf(len(aqpara['lb']), aqpara['lb'],
                                               aqpara['ub'], 1.)
ojfn = objectives.costfnwrap(ojf, cfn)
ojfchar = {'dx': len(aqpara['lb']), 'dev': len(aqpara['ev'])}
aqpara['cfn'] = cfn
aqpara['xau'] = 1.
aqpara['xal'] = 0.

#cfn = objectives.cf42
#ojfn,xmin,ymin = objectives.genmat52ojf(len(aqpara['lb']),aqpara['lb'],aqpara['ub'])
#ojfchar = {'dx':len(aqpara['lb']),'dev':len(aqpara['ev'])}

stoppara = {'nmax': 20}
stopfn = optimize.nstopfn

reccfn, reccpara = reccomenders.gpasmap
reccpara['lb'] = aqpara['lb']
reccpara['ub'] = aqpara['ub']