def line_search(cls): optimize.initialize_search() while True: cls.evaluate_function() optimize.update_status() if optimize.isdone: optimize.finalize_search() break elif optimize.step_count < PAR.STEPMAX: optimize.compute_step() continue else: retry = optimize.retry_status if retry: print ' Line search failed... retry' optimize.restart() cls.line_search() break else: print ' Line search failed... abort' sys.exit(-1)
def iterate_search(self): """ First, calls self.evaluate_function, which carries out a forward simulation given the current trial model. Then calls optimize.update_status, which maintains search history and checks stopping conditions. """ if PAR.VERBOSE > 0: print " trial step", optimize.step_count + 1 self.evaluate_function() optimize.update_status()
def iterate_search(self): """ First, calls self.evaluate_function, which carries out a forward simulation given the current trial model. Then calls optimize.update_status, which maintains search history and checks stopping conditions. """ if PAR.VERBOSE: print " trial step", optimize.step_count+1 self.evaluate_function() optimize.update_status()