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

Passing extra arguments to the evaluation_function #70

Closed
arvieFrydenlund opened this issue May 5, 2019 · 5 comments
Closed

Passing extra arguments to the evaluation_function #70

arvieFrydenlund opened this issue May 5, 2019 · 5 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@arvieFrydenlund
Copy link

arvieFrydenlund commented May 5, 2019

I am trying to do a hyper-parameter search over a subset of the overall model hyperparameters. This subset has been defined for the search space, however, my evaluation_function needs access to the rest in order to pass them to the model's trainer. I feel like this might conflict with Ax's design philosophy but I have a considerable number of these and its annoying to define them both through argparse and then again through ax.

  1. Is there a way of passing these to the evaluation_function function without creating a parameter for them in the search space i.e. having them as part of the parameterization?

  2. If not is there a helper function which converts and argparse to ax parameters? or something similar.

Thanks.

@eytan
Copy link
Contributor

eytan commented May 5, 2019 via email

@arvieFrydenlund
Copy link
Author

That kind of helps but not fully.

I can partially use that to convert an argparse object to a list of fixed parameters, however, there are some types that can't be converted, for example, there isn't a ParameterType for list (which is not being used as a range).

@amurthy1
Copy link

amurthy1 commented May 7, 2019

If these other parameters are fixed for all trials, can they be encoded directly in the evaluation_function itself rather than passed as arguments? You could even write a wrapper function which takes the fixed params as inputs and outputs an evaluation_function with them encoded inside.

If by argparse you mean an easy to use CLI, that is something we've discussed supporting and would be interested to know how you're using it with CLI.

@kkashin kkashin added enhancement New feature or request question Further information is requested labels May 7, 2019
@arvieFrydenlund
Copy link
Author

Thanks, the wrapper function worked.

And yes this was for CLI. I'm trying to do Bayesian optimization on a pre-existing library which uses CLI to define the model and I was trying to integrate ax with minimal changes to the existing code.

@amurthy1
Copy link

amurthy1 commented May 7, 2019

Ah so not invoking Ax via CLI. Glad this solution worked for you.

@amurthy1 amurthy1 closed this as completed May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants