@@ -30,6 +30,7 @@ def find_local_max_ipopt(
3030 partially_fixed_experiments : Optional [pd .DataFrame ] = None ,
3131 use_hessian : bool = False ,
3232 use_cyipopt : Optional [bool ] = None ,
33+ seed : Optional [int ] = None ,
3334) -> pd .DataFrame :
3435 """Function computing an optimal design for a given domain and model.
3536
@@ -47,6 +48,7 @@ def find_local_max_ipopt(
4748 use_hessian: If True, the hessian of the objective function is used. Default is False.
4849 use_cyipopt: If True, cyipopt is used, otherwise scipy.minimize(). Default is None.
4950 If None, cyipopt is used if available.
51+ seed: Random seed for sampling. Defaults to None, in this case no seed is given to the
5052
5153 Returns:
5254 A pd.DataFrame object containing the best found input for the experiments. In general, this is only a
@@ -101,7 +103,9 @@ def find_local_max_ipopt(
101103 sampling .sort_index (axis = 1 , inplace = True )
102104 x0 = sampling .values .flatten ()
103105 try :
104- sampler = RandomStrategy (data_model = RandomStrategyDataModel (domain = domain ))
106+ sampler = RandomStrategy (
107+ data_model = RandomStrategyDataModel (domain = domain , seed = seed )
108+ )
105109 x0 = (
106110 sampler .ask (n_experiments , raise_validation_error = False )
107111 .to_numpy ()
@@ -115,7 +119,9 @@ def find_local_max_ipopt(
115119 possibly improve performance." ,
116120 )
117121 x0 = (
118- domain .inputs .sample (n = n_experiments , method = SamplingMethodEnum .UNIFORM )
122+ domain .inputs .sample (
123+ n = n_experiments , method = SamplingMethodEnum .UNIFORM , seed = seed
124+ )
119125 .to_numpy ()
120126 .flatten ()
121127 )
0 commit comments