Skip to content
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

[GENERAL SUPPORT]: How to run MFBO in ax? #3429

Open
1 task done
fightpf opened this issue Feb 27, 2025 · 4 comments
Open
1 task done

[GENERAL SUPPORT]: How to run MFBO in ax? #3429

fightpf opened this issue Feb 27, 2025 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@fightpf
Copy link

fightpf commented Feb 27, 2025

Question

Hello everyone,

I have set up the following workflow for MFBO, hoping that after loading existing data, the model will recommend a new experiment for me:

parameters.append(
    RangeParameter(
        name=fidelity_para_info["name"],
        parameter_type=ParameterType.FLOAT,
        lower=fidelity_para_info["low"],
        upper=fidelity_para_info["high"],
        is_fidelity=fidelity_para_info["is_fidelity"],
        target_value=1
    )
)
search_space = SearchSpace(parameters=parameters)
experiment = Experiment(name="my_experiment", search_space=search_space)

# (Omitting the part where old data (arms) and objective data are loaded)

botorch_kwargs = {
    "experiment": experiment,
    "data": experiment.fetch_data(),
}
model = Models.BOTORCH_MODULAR(**botorch_kwargs)
candidate = model.gen(gen_num)

However, this does not seem to work. Are there any relevant examples I can refer to?

Thanks in advance!

Please provide any relevant code snippet if applicable.

Code of Conduct

  • I agree to follow this Ax's Code of Conduct
@fightpf fightpf added the question Further information is requested label Feb 27, 2025
@bernardbeckerman
Copy link
Contributor

Hi there,

According to the Modular BoTorchModel tutorial Appendix 2 (link), this should work as expected.

this does not seem to work

Can you copy-paste the error you're getting or what is indicating to you that this is not working as expected?

@bernardbeckerman bernardbeckerman self-assigned this Feb 28, 2025
@fightpf
Copy link
Author

fightpf commented Mar 1, 2025

Hi sir,

If I want to perform multi-objective MFBO, is it possible?

@fightpf
Copy link
Author

fightpf commented Mar 3, 2025

I used BOTORCH_MODULAR, will get the following error message:

from botorch.models.model import Model
model = Models.BOTORCH_MODULAR(**botorch_kwargs)
candidate = model.gen(n=int(gen_num.value))

TypeError: Unexpected keyword argument target_fidelities when constructing input arguments for construct_inputs_qLogNEHVI.

When I switch to YYY, the following error appears.

from ax.modelbridge.factory import get_GPEI, get_botorch
model = get_botorch(**botorch_kwargs)
candidate = model.gen(n=int(gen_num.value))

NotImplementedError: Base BotorchModel does not support fidelity_features.

Thank you very much for your assistance.

@bernardbeckerman
Copy link
Contributor

If I want to perform multi-objective MFBO, is it possible?

I'm not 100% sure, but I don't see why not. Would you please paste a minimal reproducible example so that I can recreate your setup locally and help debug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants