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 line_search(self): """ Conducts line search in given search direction """ optimize.initialize_search() for optimize.step in range(1, PAR.SRCHMAX+1): isdone = self.search_status() if isdone == 1: optimize.finalize_search() break elif isdone == 0: optimize.compute_step() continue elif isdone == -1: self.isdone = -1 print ' line search failed'
def line_search(self): """ Conducts line search in given search direction """ optimize.initialize_search() while True: self.iterate_search() 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\n\n Retrying...' optimize.restart() self.line_search() break else: print ' Line search failed\n\n Aborting...' sys.exit(-1)
def line_search(self): """ Conducts line search in given search direction """ optimize.initialize_search() while True: self.iterate_search() 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...\n\n Retrying...' optimize.restart() self.line_search() break else: print ' Line search failed...\n\n Aborting...' sys.exit(-1)