def run_func(f,x,b = None,i = None,**ekwgs): dim = len(inspect.getargspec(f)[0])-1 bounds = tuple(sa.bound(f,x,10**d,j,dim) for j in range(dim)) actual = sa.random_position(bounds) y = f(x,*actual) result,derror = sa.run(f,x,y,b,i,**ekwgs) summary = summarize(f,x,i,actual,result,derror) return result,summary
def runf(self,f,x,y,a,g,b,**kws): t = time.time() res,err = sa.run(f,x,y,b,g,**kws) perror = tuple(abs((r-a)/a)*100.0 for r,a in zip(res,a)) return res,perror,err,time.time()-t