-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathparamnet_benchmark.py
599 lines (456 loc) · 25.3 KB
/
paramnet_benchmark.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
"""
How to use this benchmark:
--------------------------
We recommend using the containerized version of this benchmark.
If you want to use this benchmark locally (without running it via the corresponding container),
you need to perform the following steps.
Prerequisites:
==============
Conda environment in which the HPOBench is installed (pip install .). Activate your environment.
```
conda activate <Name_of_Conda_HPOBench_environment>
```
1. Download data:
=================
The data will be downloaded automatically.
If you want to download the data on your own, you can download the data with the following command and then link the
hpobench-config's data-path to it.
```
wget https://www.automl.org/wp-content/uploads/2019/05/surrogates.tar.gz
```
The data consist of surrogates for different data sets. Each surrogate is a pickled scikit-learn forest. Thus, we have
a hard requirement of scikit-learn==0.23.x.
1. Clone from github:
=====================
```
git clone HPOBench
```
2. Clone and install
====================
```
cd /path/to/HPOBench
pip install .[paramnet]
```
Changelog:
==========
0.0.4
* New container release due to a general change in the communication between container and HPOBench.
Works with HPOBench >= v0.0.8
0.0.3:
* Fix returned dictionary from Objective Function for ParamNetOnTime Benchmarks.
* Suppress Warning (Surrogate was created with scikit-learn version 0.18.1 and current is 0.23.2)
* Add another Search Space: Reduced.
0.0.2:
* Fix OnTime Test function:
The `objective_test_function` of the OnTime Benchmarks now checks if the budget is the right maximum budget.
* Standardize the structure of the meta information
0.0.1:
* First implementation
"""
import warnings
import logging
from typing import Union, Dict
import ConfigSpace as CS
import numpy as np
from hpobench.abstract_benchmark import AbstractBenchmark
from hpobench.util.data_manager import ParamNetDataManager
__version__ = '0.0.3'
logger = logging.getLogger('Paramnet')
class _ParamnetBase(AbstractBenchmark):
def __init__(self, dataset: str,
rng: Union[np.random.RandomState, int, None] = None):
"""
Parameters
----------
dataset : str
Name for the surrogate data. Must be one of ["adult", "higgs", "letter", "mnist", "optdigits", "poker"]
rng : np.random.RandomState, int, None
"""
self.dataset = dataset
self.n_epochs = 50
super(_ParamnetBase, self).__init__(rng=rng)
allowed_datasets = ["adult", "higgs", "letter", "mnist", "optdigits", "poker", "vehicle"]
assert dataset in allowed_datasets, f'Requested data set is not supported. Must be one of ' \
f'{", ".join(allowed_datasets)}, but was {dataset}'
logger.info(f'Start Benchmark on dataset {dataset}')
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="Trying to unpickle")
dm = ParamNetDataManager(dataset=dataset)
self.surrogate_objective, self.surrogate_costs = dm.load()
@staticmethod
def convert_config_to_array(configuration: Dict) -> np.ndarray:
raise NotImplementedError()
@staticmethod
def get_configuration_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
raise NotImplementedError()
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
raise NotImplementedError()
@staticmethod
def get_meta_information():
""" Returns the meta information for the benchmark """
return {'name': 'ParamNet Benchmark',
'references': ['@InProceedings{falkner-icml-18,'
'title = {{BOHB}: Robust and Efficient Hyperparameter Optimization at Scale},'
'url = http://proceedings.mlr.press/v80/falkner18a.html'
'author = {Falkner, Stefan and Klein, Aaron and Hutter, Frank}, '
'booktitle = {Proceedings of the 35th International Conference on Machine Learning},'
'pages = {1436 - 1445},'
'year = {2018}}'],
'code': 'https://github.com/automl/HPOlib1.5/blob/development/'
'hpolib/benchmarks/surrogates/paramnet.py'
}
class _ParamnetFull(_ParamnetBase):
@staticmethod
def convert_config_to_array(configuration: Dict) -> np.ndarray:
"""
This function transforms a configuration to a numpy array.
Since some of the values in the configuration space are in log space, cast it back to the original space.
Furthermore, we round the parameters ``batch size`` and ``average unit per layer`` to their next integer.
This is different to the original implementation of the paramnet benchmark from HPOlib1.5
Parameters
----------
configuration : Dict
Returns
-------
np.ndarray - The configuration transformed back to its original space
"""
cfg_array = np.zeros(8)
cfg_array[0] = 10 ** configuration['initial_lr_log10']
cfg_array[1] = round(2 ** configuration['batch_size_log2'])
cfg_array[2] = round(2 ** configuration['average_units_per_layer_log2'])
cfg_array[3] = 10 ** configuration['final_lr_fraction_log2']
cfg_array[4] = configuration['shape_parameter_1']
cfg_array[5] = configuration['num_layers']
cfg_array[6] = configuration['dropout_0']
cfg_array[7] = configuration['dropout_1']
return cfg_array.reshape((1, -1))
@staticmethod
def get_configuration_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
"""
Parameters
----------
seed : int, None
Fixing the seed for the ConfigSpace.ConfigurationSpace
Returns
-------
ConfigSpace.ConfigurationSpace
"""
seed = seed if seed is not None else np.random.randint(1, 100000)
cs = CS.ConfigurationSpace(seed=seed)
cs.add_hyperparameters([
CS.UniformFloatHyperparameter('initial_lr_log10', lower=-6, upper=-2, default_value=-4, log=False),
CS.UniformFloatHyperparameter('batch_size_log2', lower=3, upper=8, default_value=5.5, log=False),
CS.UniformFloatHyperparameter('average_units_per_layer_log2', lower=4, upper=8, default_value=6, log=False),
CS.UniformFloatHyperparameter('final_lr_fraction_log2', lower=-4, upper=0, default_value=-2, log=False),
CS.UniformFloatHyperparameter('shape_parameter_1', lower=0., upper=1., default_value=0.5, log=False),
CS.UniformIntegerHyperparameter('num_layers', lower=1, upper=5, default_value=3, log=False),
CS.UniformFloatHyperparameter('dropout_0', lower=0., upper=0.5, default_value=0.25, log=False),
CS.UniformFloatHyperparameter('dropout_1', lower=0., upper=0.5, default_value=0.25, log=False),
])
return cs
class _ParamnetReduced(_ParamnetBase):
@staticmethod
def convert_config_to_array(configuration: Dict) -> np.ndarray:
"""
This function transforms a configuration to a numpy array.
Since some of the values in the configuration space are in log space, cast it back to the original space.
Furthermore, we round the parameters ``batch size`` and ``average unit per layer`` to their next integer.
This is different to the original implementation of the paramnet benchmark from HPOlib1.5
Parameters
----------
configuration : Dict
Returns
-------
np.ndarray - The configuration transformed back to its original space
"""
cfg_array = np.zeros(8)
cfg_array[0] = 10 ** configuration['initial_lr_log10']
cfg_array[1] = round(2 ** configuration['batch_size_log2'])
cfg_array[2] = round(2 ** configuration['average_units_per_layer_log2'])
cfg_array[3] = 10 ** configuration['final_lr_fraction_log2']
cfg_array[4] = 0.5
cfg_array[5] = configuration['num_layers']
cfg_array[6] = configuration['dropout']
cfg_array[7] = configuration['dropout']
return cfg_array.reshape((1, -1))
@staticmethod
def get_configuration_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
"""
Parameters
----------
seed : int, None
Fixing the seed for the ConfigSpace.ConfigurationSpace
Returns
-------
ConfigSpace.ConfigurationSpace
"""
seed = seed if seed is not None else np.random.randint(1, 100000)
cs = CS.ConfigurationSpace(seed=seed)
cs.add_hyperparameters([
CS.UniformFloatHyperparameter('initial_lr_log10', lower=-6, upper=-2, default_value=-4, log=False),
CS.UniformFloatHyperparameter('batch_size_log2', lower=3, upper=8, default_value=5.5, log=False),
CS.UniformFloatHyperparameter('average_units_per_layer_log2', lower=4, upper=8, default_value=6, log=False),
CS.UniformFloatHyperparameter('final_lr_fraction_log2', lower=-4, upper=0, default_value=-2, log=False),
# CS.UniformFloatHyperparameter('shape_parameter_1', lower=0., upper=1., default_value=0.5, log=False),
CS.UniformIntegerHyperparameter('num_layers', lower=1, upper=5, default_value=3, log=False),
# CS.UniformFloatHyperparameter('dropout_0', lower=0., upper=0.5, default_value=0.25, log=False),
CS.UniformFloatHyperparameter('dropout', lower=0., upper=0.5, default_value=0.25, log=False),
])
return cs
class _ParamnetOnStepsBenchmark(_ParamnetBase):
def __init__(self, dataset: str,
rng: Union[np.random.RandomState, int, None] = None):
"""
Parameters
----------
dataset : str
Name for the surrogate data. Must be one of ["adult", "higgs", "letter", "mnist", "optdigits", "poker"]
rng : np.random.RandomState, int, None
"""
super(_ParamnetOnStepsBenchmark, self).__init__(rng=rng, dataset=dataset)
@AbstractBenchmark.check_parameters
def objective_function(self, configuration: Union[CS.Configuration, Dict],
fidelity: Union[CS.Configuration, Dict, None] = None,
rng: Union[np.random.RandomState, int, None] = None, **kwargs) -> Dict:
cfg_array = self.convert_config_to_array(configuration)
lc = self.surrogate_objective.predict(cfg_array)[0]
c = self.surrogate_costs.predict(cfg_array)[0]
obj_value = lc[fidelity['step'] - 1]
cost = (c / self.n_epochs) * fidelity['step']
# return {'function_value': y, "cost": cost, "learning_curve": lc}
return {'function_value': obj_value,
"cost": cost,
'info': {'fidelity': fidelity}}
@AbstractBenchmark.check_parameters
def objective_function_test(self, configuration: Union[CS.Configuration, Dict],
fidelity: Union[CS.Configuration, Dict, None] = None,
rng: Union[np.random.RandomState, int, None] = None, **kwargs) -> Dict:
assert fidelity['step'] == 50, f'Only querying a result for the 50. epoch is allowed, ' \
f'but was {fidelity["step"]}.'
return self.objective_function(configuration, fidelity={'step': 50}, rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
"""
Creates a ConfigSpace.ConfigurationSpace containing all fidelity parameters for
the SupportVector Benchmark
Fidelities
----------
step: int - [1, 50]
Step, when to query the surrogate model
Parameters
----------
seed : int, None
Fixing the seed for the ConfigSpace.ConfigurationSpace
Returns
-------
ConfigSpace.ConfigurationSpace
"""
seed = seed if seed is not None else np.random.randint(1, 100000)
fidel_space = CS.ConfigurationSpace(seed=seed)
fidel_space.add_hyperparameters([
CS.UniformIntegerHyperparameter("step", lower=1, upper=50, default_value=50, log=False),
])
return fidel_space
@staticmethod
def get_meta_information():
""" Returns the meta information for the benchmark """
meta_info = _ParamnetBase.get_meta_information()
meta_info.update({'info': 'This benchmark uses the epochs as fidelity.'})
return meta_info
class _ParamnetOnTimeBenchmark(_ParamnetBase):
@AbstractBenchmark.check_parameters
def objective_function(self, configuration: Union[CS.Configuration, Dict],
fidelity: Union[CS.Configuration, Dict, None] = None,
rng: Union[np.random.RandomState, int, None] = None, **kwargs) -> Dict:
config_array = self.convert_config_to_array(configuration)
lc = self.surrogate_objective.predict(config_array)[0]
costs = self.surrogate_costs.predict(config_array)[0]
# If we can't afford a single epoch, return 1.
if (costs / self.n_epochs) > fidelity['budget']:
return {'function_value': 1.0,
'cost': fidelity['budget'],
'info': {'fidelity': fidelity,
'learning_curve': [],
'observed_epochs': 0,
'predicted_costs': float(costs),
'state': 'Not enough budget'}}
learning_curves_cost = np.linspace(costs / self.n_epochs, costs, self.n_epochs)
if fidelity['budget'] <= costs:
idx = np.where(learning_curves_cost <= fidelity['budget'])[0][-1]
y = lc[idx]
lc = lc[:idx]
else:
# If the budget is larger than the actual runtime, we extrapolate the learning curve
t_left = fidelity['budget'] - costs
n_epochs = int(t_left / (costs / self.n_epochs))
lc = np.append(lc, np.ones(n_epochs) * lc[-1])
y = lc[-1]
return {'function_value': float(y),
'cost': fidelity['budget'],
'info': {'fidelity': fidelity,
'learning_curve': lc.tolist(),
'observed_epochs': len(lc),
'predicted_costs': float(costs)}}
@AbstractBenchmark.check_parameters
def objective_function_test(self, configuration: Union[CS.Configuration, Dict],
fidelity: Union[CS.Configuration, Dict, None] = None,
rng: Union[np.random.RandomState, int, None] = None, **kwargs) -> Dict:
# Get the maximum fidelity for this benchmark.
fidelity_space = self.get_fidelity_space()
max_budget = fidelity_space.get_hyperparameter('budget').upper
assert fidelity['budget'] == max_budget, f'Only querying a result for a budget of {max_budget} is allowed, ' \
f'but was {fidelity["budget"]}.'
return self.objective_function(configuration, fidelity={'budget': max_budget}, rng=rng)
@staticmethod
def _get_fidelity_space(dataset: str, seed: Union[int, None] = None) -> CS.ConfigurationSpace:
"""
Creates a ConfigSpace.ConfigurationSpace containing all fidelity parameters for
the SupportVector Benchmark
Fidelities
----------
budget float - [0, Max Time in S]
Time which is used to train the network
Parameters
----------
seed : int, None
Fixing the seed for the ConfigSpace.ConfigurationSpace
Returns
-------
ConfigSpace.ConfigurationSpace
"""
budgets = { # . (min, max)-budget (seconds) for the different data sets
'adult': (9, 243),
'higgs': (9, 243),
'letter': (3, 81),
'mnist': (9, 243),
'optdigits': (1, 27),
'poker': (81, 2187),
}
min_budget, max_budget = budgets[dataset]
seed = seed if seed is not None else np.random.randint(1, 100000)
fidel_space = CS.ConfigurationSpace(seed=seed)
fidel_space.add_hyperparameters([
CS.UniformIntegerHyperparameter("budget", lower=min_budget, upper=max_budget, default_value=max_budget)
])
return fidel_space
@staticmethod
def get_meta_information():
""" Returns the meta information for the benchmark """
meta_info = _ParamnetBase.get_meta_information()
meta_info.update(
{'note': 'This benchmark uses the training time as fidelity. '
'The budgets are described in I.2 Table 2 on page 17. '
'https://arxiv.org/pdf/1807.01774.pdf. '
'Also, note that the code for extrapolating the learning curve, when the budget was higher than '
'the total costs, was introduced in the original implemention in the HPOlib1.5',
})
return meta_info
class ParamNetAdultOnStepsBenchmark(_ParamnetFull, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetAdultOnStepsBenchmark, self).__init__(dataset='adult', rng=rng)
class ParamNetAdultOnTimeBenchmark(_ParamnetFull, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetAdultOnTimeBenchmark, self).__init__(dataset='adult', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='adult', seed=seed)
class ParamNetReducedAdultOnStepsBenchmark(_ParamnetReduced, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedAdultOnStepsBenchmark, self).__init__(dataset='adult', rng=rng)
class ParamNetReducedAdultOnTimeBenchmark(_ParamnetReduced, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedAdultOnTimeBenchmark, self).__init__(dataset='adult', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='adult', seed=seed)
class ParamNetHiggsOnStepsBenchmark(_ParamnetFull, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetHiggsOnStepsBenchmark, self).__init__(dataset='higgs', rng=rng)
class ParamNetHiggsOnTimeBenchmark(_ParamnetFull, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetHiggsOnTimeBenchmark, self).__init__(dataset='higgs', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='higgs', seed=seed)
class ParamNetReducedHiggsOnStepsBenchmark(_ParamnetReduced, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedHiggsOnStepsBenchmark, self).__init__(dataset='higgs', rng=rng)
class ParamNetReducedHiggsOnTimeBenchmark(_ParamnetReduced, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedHiggsOnTimeBenchmark, self).__init__(dataset='higgs', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='higgs', seed=seed)
class ParamNetLetterOnStepsBenchmark(_ParamnetFull, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetLetterOnStepsBenchmark, self).__init__(dataset='letter', rng=rng)
class ParamNetLetterOnTimeBenchmark(_ParamnetFull, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetLetterOnTimeBenchmark, self).__init__(dataset='letter', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='letter', seed=seed)
class ParamNetReducedLetterOnStepsBenchmark(_ParamnetReduced, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedLetterOnStepsBenchmark, self).__init__(dataset='letter', rng=rng)
class ParamNetReducedLetterOnTimeBenchmark(_ParamnetReduced, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedLetterOnTimeBenchmark, self).__init__(dataset='letter', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='letter', seed=seed)
class ParamNetMnistOnStepsBenchmark(_ParamnetFull, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetMnistOnStepsBenchmark, self).__init__(dataset='mnist', rng=rng)
class ParamNetMnistOnTimeBenchmark(_ParamnetFull, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetMnistOnTimeBenchmark, self).__init__(dataset='mnist', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='mnist', seed=seed)
class ParamNetReducedMnistOnStepsBenchmark(_ParamnetReduced, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedMnistOnStepsBenchmark, self).__init__(dataset='mnist', rng=rng)
class ParamNetReducedMnistOnTimeBenchmark(_ParamnetReduced, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedMnistOnTimeBenchmark, self).__init__(dataset='mnist', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='mnist', seed=seed)
class ParamNetOptdigitsOnStepsBenchmark(_ParamnetFull, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetOptdigitsOnStepsBenchmark, self).__init__(dataset='optdigits', rng=rng)
class ParamNetOptdigitsOnTimeBenchmark(_ParamnetFull, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetOptdigitsOnTimeBenchmark, self).__init__(dataset='optdigits', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='optdigits', seed=seed)
class ParamNetReducedOptdigitsOnStepsBenchmark(_ParamnetReduced, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedOptdigitsOnStepsBenchmark, self).__init__(dataset='optdigits', rng=rng)
class ParamNetReducedOptdigitsOnTimeBenchmark(_ParamnetReduced, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedOptdigitsOnTimeBenchmark, self).__init__(dataset='optdigits', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='optdigits', seed=seed)
class ParamNetPokerOnStepsBenchmark(_ParamnetFull, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetPokerOnStepsBenchmark, self).__init__(dataset='poker', rng=rng)
class ParamNetPokerOnTimeBenchmark(_ParamnetFull, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetPokerOnTimeBenchmark, self).__init__(dataset='poker', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='poker', seed=seed)
class ParamNetReducedPokerOnStepsBenchmark(_ParamnetReduced, _ParamnetOnStepsBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedPokerOnStepsBenchmark, self).__init__(dataset='poker', rng=rng)
class ParamNetReducedPokerOnTimeBenchmark(_ParamnetReduced, _ParamnetOnTimeBenchmark):
def __init__(self, rng: Union[np.random.RandomState, int, None] = None):
super(ParamNetReducedPokerOnTimeBenchmark, self).__init__(dataset='poker', rng=rng)
@staticmethod
def get_fidelity_space(seed: Union[int, None] = None) -> CS.ConfigurationSpace:
return _ParamnetOnTimeBenchmark._get_fidelity_space(dataset='poker', seed=seed)