Skip to content

Commit 342edf2

Browse files
authored
fix(download): Path naming for surrogate models
Minor other changes: * Clip metrics from surrogates * Reduce minimum fidelity to 1
2 parents 63c2bee + 0cf2506 commit 342edf2

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

src/mfpbench/jahs/benchmark.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class JAHSResult(Result[JAHSConfig, int]):
7777

7878
class JAHSBenchmark(Benchmark[JAHSConfig, JAHSResult, int], ABC):
7979
JAHS_FIDELITY_NAME: ClassVar[str] = "epoch"
80-
JAHS_FIDELITY_RANGE: ClassVar[tuple[int, int, int]] = (3, 200, 1)
80+
JAHS_FIDELITY_RANGE: ClassVar[tuple[int, int, int]] = (1, 200, 1)
8181
JAHS_METRICS_TO_ACTIVATE: ClassVar[tuple[str, ...]] = (
8282
"valid-acc",
8383
"test-acc",
@@ -198,7 +198,7 @@ def bench(self) -> jahs_bench.Benchmark:
198198
)
199199

200200
self._bench = jahs_bench.Benchmark(
201-
task=self.task_id,
201+
task=task,
202202
save_dir=self.datadir,
203203
download=False,
204204
metrics=self.JAHS_METRICS_TO_ACTIVATE,

src/mfpbench/pd1/benchmark.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ def _results_for(
201201
features = xs.columns
202202
for metric, surrogate in self.surrogates.items():
203203
# We clip as sometimes the surrogate produces negative values
204-
xs[metric] = surrogate.predict(xs[features]).clip(min=0)
204+
bounds = self.Result.metric_defs[metric].bounds
205+
xs[metric] = surrogate.predict(xs[features]).clip(*bounds)
205206

206207
metrics = list(self.surrogates.keys())
207208
return [dict(r[metrics]) for _, r in xs.iterrows()]

src/mfpbench/pd1/benchmarks/cifar100.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77

88
class PD1cifar100_wideresnet_2048(PD1Benchmark):
9-
pd1_fidelity_range = (45, 199, 1)
9+
pd1_fidelity_range = (1, 199, 1)
1010
pd1_result_type = PD1ResultTransformer
11-
pd1_name = "cifar100-wideresnet-2048"
11+
pd1_name = "cifar100-wide_resnet-2048"
1212

1313
@classmethod
1414
def _create_space(cls, seed: int | None = None) -> ConfigurationSpace:

src/mfpbench/pd1/benchmarks/imagenet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class PD1imagenet_resnet_512(PD1Benchmark):
99
pd1_result_type = PD1ResultTransformer
10-
pd1_fidelity_range = (3, 99, 1)
10+
pd1_fidelity_range = (1, 99, 1)
1111
pd1_name = "imagenet-resnet-512"
1212

1313
@classmethod

src/mfpbench/pd1/benchmarks/translate_wmt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class PD1translatewmt_xformer_64(PD1Benchmark):
99
pd1_fidelity_range = (1, 19, 1)
1010
pd1_result_type = PD1ResultTransformer
11-
pd1_name = "translate-wmt-xformer-64"
11+
pd1_name = "translate_wmt-xformer_translate-64"
1212

1313
@classmethod
1414
def _create_space(cls, seed: int | None = None) -> ConfigurationSpace:

src/mfpbench/synthetic/hartmann/benchmark.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def __init__(
160160
config_type=self.mfh_config_type,
161161
result_type=self.mfh_result_type,
162162
fidelity_name="z",
163-
fidelity_range=(3, _max_fidelity, 1),
163+
fidelity_range=(1, _max_fidelity, 1),
164164
space=space,
165165
seed=seed,
166166
prior=prior,

0 commit comments

Comments
 (0)