Skip to content

Commit

Permalink
Working carp-s
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEimer committed Apr 19, 2024
1 parent 8405846 commit 36db50d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/configs/smac_mf_mlp_carps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ hydra:
optimizer_kwargs:
_target_: carps.optimizers.smac20.SMAC3Optimizer
_partial_: true
n_trials: 10
time_budget: 100
smac_cfg:
smac_class: smac.facade.multi_fidelity_facade.MultiFidelityFacade
scenario:
seed: ${seed}
n_trials: 10
deterministic: true
n_workers: 1
output_directory: ${outdir}/${seed}/smac3_output
min_budget: 1
max_budget: 10
smac_kwargs:
Expand Down
5 changes: 3 additions & 2 deletions hydra_plugins/hyper_carp_s/hyper_carp_s.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ def ask(self):

def tell(self, info, value):
"""Tell the result of the configuration."""
self.smac.tell(info, value)
self.carps.tell(info, value)


def make_carp_s(configspace, carps_args):
"""Make a CARP-S instance for optimization."""
problem = DummyProblem()
problem._configspace = configspace
optimizer = carps_args["optimizer"](problem)
optimizer = carps_args(problem)
optimizer.solver = optimizer._setup_optimizer()
return HyperCARPSAdapter(optimizer)

0 comments on commit 36db50d

Please sign in to comment.