@@ -724,6 +724,7 @@ def initialize(self, l0 = None, u0 = None, queue = None):
724724 # Least upper bound (LUB)
725725 self .best_node = root
726726 self .LUB = self .best_node .aq_U
727+ self .LLB = self .best_node .aq_L
727728 if queue is not None :
728729 print ("root node acqf_L, acqf_U = " , root .aq_L , root .aq_U )
729730 for _ , _ , node in queue :
@@ -827,19 +828,23 @@ def bnboptimize(self, l_init, u_init):
827828 print ("upper-bound = " , child .aq_U )
828829 assert child .aq_U >= child .aq_L , "ERROR: child upper bound < child lower bound for child"
829830 if child .aq_U <= self .LUB :
831+ self .LUB = child .aq_U
832+ if child .aq_L <= self .LLB :
830833 self .best_node = child
831- self .LUB = self .best_node .aq_U
834+ self .LLB = self .best_node .aq_L
832835 updated_best_node = True
833- gap_history .append (self .best_node .aq_U - self .best_node .aq_L )
834836 if not updated_best_node :
835837 print ("best node not updated" )
836- print ("min |child.aq_U - LUB | = " , min ([abs (child .aq_U - self .LUB ) for child in children ]))
838+ print ("min |child.aq_L - LLB | = " , min ([abs (child .aq_L - self .LLB ) for child in children ]))
837839 if self .pure_BBS and self .sync_mode :
838- idx = np .argmin ([child .aq_U for child in children ])
840+ print ("forcing best node update" )
841+ idx = np .argmin ([child .aq_L for child in children ])
839842 self .best_node = children [idx ]
840- self .LUB = self .best_node .aq_U
843+ self .LLB = self .best_node .aq_L
844+ updated_best_node = True
841845 else :
842846 print ("best node updated" )
847+ gap_history .append (self .best_node .aq_U - self .best_node .aq_L )
843848
844849 # pre-prune
845850 children_lower_bounds = [child .aq_L for child in children ]
@@ -1387,7 +1392,6 @@ def compute_acqf_bounds(self, l, u, skip_LB=False):
13871392 acqf_solve_success = False
13881393 if not self .acqf_UB_solver == "MINEVAL" : # local gradient-based optimization method
13891394 constraints = []
1390- #box_bounds = [[l[i], u[i]] for i in range(len(l))]
13911395 box_bounds = np .array ([l , u ]).T
13921396 acqf_callback = {'obj' : self .acqf .scalar_evaluate }
13931397 if self .acqf .has_gradient :
0 commit comments