@@ -258,9 +258,8 @@ def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
258258 ConfigSpace.ConfigurationSpace
259259 """
260260 fidelity_space = CS .ConfigurationSpace (seed = seed )
261- fidelity_space .add_hyperparameters ([CS .UniformIntegerHyperparameter (
262- 'budget' , lower = 1 , upper = 25 , default_value = 25 , log = False
263- )
261+ fidelity_space .add_hyperparameters ([
262+ CS .UniformIntegerHyperparameter ('budget' , lower = 1 , upper = 25 , default_value = 25 , log = False )
264263 ])
265264 return fidelity_space
266265
@@ -298,6 +297,7 @@ def init_model(self, config: Union[CS.Configuration, Dict]) -> Net:
298297 def __seed_everything (self ):
299298 """Helperfunction: Make the benchmark deterministic by setting the correct seeds"""
300299 seed = self .rng .randint (0 , 100000 )
300+ logger .debug (f'Generate seed: { seed } ' )
301301 random .seed (seed )
302302 np .random .seed (seed )
303303 torch .manual_seed (seed )
@@ -361,8 +361,10 @@ def objective_function(self, configuration: Union[CS.Configuration, Dict],
361361 -------
362362 Dict -
363363 function_value : Dict
364- validation_accuracy: float
365- model_size: float
364+ negative_accuracy: float
365+ -100 * validation accuracy
366+ log_model_size: float
367+ log10 of the number of parameters
366368 cost : time to train the network
367369 info : Dict
368370 train_accuracy : float,
@@ -433,8 +435,8 @@ def objective_function(self, configuration: Union[CS.Configuration, Dict],
433435
434436 elapsed_time = time .time () - time_in
435437
436- return {'function_value' : {'accuracy' : val_accuracy ,
437- 'model_size ' : num_params },
438+ return {'function_value' : {'negative_accuracy' : - 100 * val_accuracy ,
439+ 'log_model_size ' : float ( np . log10 ( num_params )) },
438440 'cost' : float (training_runtime ),
439441 'info' : {'train_accuracy' : train_accuracy ,
440442 'training_cost' : training_runtime ,
@@ -477,8 +479,10 @@ def objective_function_test(self, configuration: Union[CS.Configuration, Dict],
477479 -------
478480 Dict -
479481 function_value : Dict
480- validation_accuracy: float
481- model_size: float
482+ negative_accuracy: float
483+ -100 * test accuracy
484+ log_model_size: float
485+ log10 of the number of parameters
482486 cost : time to train the network
483487 info : Dict
484488 train_accuracy : float,
@@ -542,8 +546,8 @@ def objective_function_test(self, configuration: Union[CS.Configuration, Dict],
542546
543547 elapsed_time = time .time () - time_in
544548
545- return {'function_value' : {'accuracy' : test_accuracy ,
546- 'model_size ' : num_params },
549+ return {'function_value' : {'negative_accuracy' : - 100 * test_accuracy ,
550+ 'log_model_size ' : float ( np . log10 ( num_params )) },
547551 'cost' : training_runtime ,
548552 'info' : {'train_accuracy' : train_accuracy ,
549553 'training_cost' : training_runtime ,
0 commit comments