-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating new Info instances before using tell #3
Comments
I agree, it's easier to use the saved ones, but why does it cause issues? Is SMAC so sensitive that e.g. rounding errors make a difference? |
Short answer: Yes. Long answer: In this situation # %%
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import logging
import os
import math
import time
import json
import pickle
import numpy as np
from ConfigSpace.hyperparameters import (
CategoricalHyperparameter,
NormalIntegerHyperparameter,
OrdinalHyperparameter,
UniformIntegerHyperparameter,
)
from py_experimenter.result_processor import ResultProcessor
from hydra.utils import to_absolute_path
# from deepcave import Recorder, Objective
from smac import HyperparameterOptimizationFacade, Scenario
from smac.intensifier.hyperband import Hyperband
from smac.runhistory.dataclasses import TrialValue, TrialInfo
import pickle
# %%
with open("minimal_working_example/scenario.pkl", "rb") as file:
scenario=pickle.load(file)
# %%
scenario
# %%
# Kann es wegen dem budget kaputt gehen?
# %%
intensifier = HyperparameterOptimizationFacade.get_intensifier(
scenario,
max_config_calls=1, # TODO is this an issue?
)
# %%
def dummy(arg, seed, budget):
return -1
# %%
smac = HyperparameterOptimizationFacade(
scenario,
dummy,
intensifier=intensifier,
overwrite=True
)
# %%
config = smac.ask()
info = TrialInfo(budget=100, seed=0.0, config=config.config)
value = TrialValue(cost=float(-1.0))
smac.tell(info=info, value=value)
# %%
info
# %%
new_config = smac.ask() The smac.ask hits an infinite loop. I do not understand the details of smac, but by reusing the same info object this could be solved |
Now infos aren't parsed anymore, does it work now? |
I am not using the current hypersweeper version, but will look into it, when adding the py-experimenter :D |
Description
Before utilizing tell, the software creates a new Info instance, thereby possibly using different values, than used originally. This can cause issues in
smac
Additional Info
I would recommend saving the info instances and using them to process tell.
The text was updated successfully, but these errors were encountered: