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

HyperOptArgumentParser explicit argument behaviour #78

Open
ilsenatorov opened this issue Jan 14, 2021 · 1 comment
Open

HyperOptArgumentParser explicit argument behaviour #78

ilsenatorov opened this issue Jan 14, 2021 · 1 comment

Comments

@ilsenatorov
Copy link

When I first started using the package (great work btw, thanks a lot!) I assumed that the intended behaviour for HyperOptArgumentParser is to only only iterate over the hyperparams if they are not specified in the cli.

In my opinion this would be the convenient designated behaviour and if people agree I could implement it (currently I'm using a hacky work-around.

So currently if I run python hyperparam.py --arg1 128 and the arg1 is specified as

parser.opt_list(--arg1, options=[128, 256, 512])

It would still iterate over the arg1 options. My desired behaviour would be to only iterate over the options if the argument is not explicitly given.

Currently I use this hack:

class MyArgParser(HyperOptArgumentParser):
    def my_opt_list(self, name, default, dtype, options, **kwargs):
        tunable = (name not in sys.argv)
        self.opt_list(name, default=default, type=dtype, tunable=tunable,
                      options=options,**kwargs)

Which I would be happy to implement if I'm not the only one facing this issue.

@MoRoBe-Work
Copy link

I stumbled upon this issue while trying to figure out a way to tune only a list of chosen hyperparams but actually the behavior you described is way more intuitive, straightforward and convenient to use. On Monday I will first copy your current solution to my code, thank you for sharing it. If you were still motivated to do so I absolutely support implementing this as the default behavior.

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