示例#1
0
文件: fitters.py 项目: RONNCC/bumps
 def solve(self, monitors=None, mapper=None, **options):
     _fill_defaults(options, self.settings)
     from quasinewton import quasinewton, STATUS
     self._update = MonitorRunner(problem=self.problem,
                                  monitors=monitors)
     result = quasinewton(fn=self.problem.nllf,
                          x0=self.problem.getp(),
                          monitor=self._monitor,
                          itnlimit=options['steps'],
                          )
     code = result['status']
     print "%d: %s" % (code, STATUS[code])
     return result['x'], result['fx']
示例#2
0
 def fmin(f,x0,fprime):
     try:
         return quasinewton(fn=f,x0=x0,grad=fprime)['x']
     except:
         return x0
示例#3
0
 def fmin(f, x0, fprime):
     try:
         return quasinewton(fn=f, x0=x0, grad=fprime, itnlimit=100)['x']
     except:
         #raise
         return x0
示例#4
0
文件: xpeek.py 项目: scattering/ipeek
 def fmin(f, x0, fprime):
     try:
         return quasinewton(fn=f, x0=x0, grad=fprime, itnlimit=100)["x"]
     except:
         # raise
         return x0
示例#5
0
文件: xpeek.py 项目: ourobouros/WRed
 def fmin(f,x0,fprime):
     try:
         return quasinewton(fn=f,x0=x0,grad=fprime)['x']
     except:
         return x0