PetrochukM/HParams

enhancements for command line arguments

Open

#2 创建于 2019年11月27日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Python (8 fork)github user discovery
enhancementhelp wanted

仓库指标

Star
 (131 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

This is an issue to discuss possible enhancements around cli overrides. Curious to hear thoughts as I have some ideas, but I haven't reflected on them a long time, and I'm not sure if they are good.

The syntax for command line arguments is verbose:

file.py --torch.optim.adam.Adam.__init__ 'HParams(lr=0.1,betas=(0.999,0.99))'

Just thinking off the top of my head here, but maybe it could be instead something like

file.py ,Adam[lr=0.1,betas=[0.999,0.99]]

Ideas here: , indicates args to be parsed by HParams; Adam just needs to match a unique substring; __init__ is the default method; no need to explicitly write HParams; brackets instead of parens to lessen the need for quotation.

Of course, for the most commonly used cli args, maybe it is already relatively straightforward to explicitly set up shortcuts so that you could write something like

file.py --lr .1 --beta1 .999 --beta2 .99

Possibly some small utility function in the libary could make setting up short custom args like these even easier.

Also, something that I don't know too much about but could be interesting to investigate is automating bash tab completion.

贡献者指南