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

Question: extra outputs is not compatible with context manager with multiple context variables? #312

Open
clairecp opened this issue Jul 17, 2020 · 1 comment

Comments

@clairecp
Copy link
Contributor

Hello everyone!

When using extra_outputs from the user_function, I was expecting extra_outputs to be directly usable as context? However in emukit.core.loop.user_function.py, the extra outputs have to be np.ndarrays of at least 2d and so the dictionary of extra_outputs that is returned is of the form {'key0': array([2.1]), 'key1': array([2.]), 'key2': array([1.])}.

By using this dictionary as context, when multiple context values are present, the expend_vector method in core.optimization.context_manager.py fails with a broadcast error because the context_values is no longer 1d.

This is not really an issue, as we can simply process the extra_outputs after getting them from the user_function_result to make them simple values instead of arrays. But I wanted to ask if the requirements for extra_outputs to be 2d numpy arrays is due to some functionality I am missing?
I was expecting the extra_outputs to be directly compatible with context_manager when used as context?

Looking forward to your answer,
Thanks!

@mmahsereci
Copy link
Contributor

hi @clairecp , could you perhaps supply a code sniped that shows where the code fails? It would be easier for me to understand precisely what you are referring. Thanks!

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

No branches or pull requests

2 participants