<s> '''<STR_LIT>''' <EOL> import DIRECT <EOL> import numpy as np <EOL> from robo . maximizers . base_maximizer import BaseMaximizer <EOL> class Direct ( BaseMaximizer ) : <EOL> def __init__ ( self , objective_function , X_lower , X_upper , <EOL> n_func_evals = <NUM_LIT> , n_iters = <NUM_LIT:200> ) : <EOL> """<STR_LIT>""" <EOL> self . n_func_evals = n_func_evals <EOL> self . n_iters = n_iters <EOL> super ( Direct , self ) . __init__ ( objective_function , X_lower , X_upper ) <EOL> def _direct_acquisition_fkt_wrapper ( self , acq_f ) : <EOL> def _l ( x , user_data ) : <EOL> return - acq_f ( np . array ( [ x ] ) ) , <NUM_LIT:0> <EOL> return _l <EOL> def maximize ( self ) : <EOL> """<STR_LIT>""" <EOL> x , _ , _ = DIRECT . solve ( <EOL> self . _direct_acquisition_fkt_wrapper ( self . objective_func ) , <EOL> l = [ self . X_lower ] , <EOL> u = [ self . X_upper ] , <EOL> maxT = self . n_iters , <EOL> maxf = self . n_func_evals ) <EOL> return np . array ( [ x ] ) </s>
