-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support help and required argument for the configs #294
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please see the inline comments for minor suggestions. THX!
@@ -3,7 +3,7 @@ def wrap_attacker_trainer(base_trainer, config): | |||
Args: | |||
base_trainer (core.trainers.GeneralTorchTrainer): the trainer that | |||
will be wrapped; | |||
config (yacs.config.CfgNode): the configure; | |||
config (core.configs.config.CN): the configure; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core.configs
-> federatedscope.core.configs
?
federatedscope/autotune/algos.py
Outdated
@@ -68,7 +67,7 @@ def run(self): | |||
def get_scheduler(init_cfg): | |||
"""To instantiate an scheduler object for conducting HPO | |||
Arguments: | |||
init_cfg (yacs.Node): configuration. | |||
init_cfg (core.configs.config.CN): configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
federatedscope/autotune/algos.py
Outdated
@@ -88,8 +87,8 @@ class Scheduler(object): | |||
def __init__(self, cfg): | |||
""" | |||
Arguments: | |||
cfg (yacs.Node): dict like object, where each key-value pair | |||
corresponds to a field and its choices. | |||
cfg (ycore.configs.config.CN): dict like object, where each |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typos
federatedscope/core/cmd_args.py
Outdated
parser.add_argument('opts', | ||
help='See federatedscope/core/configs for all options', | ||
default=None, | ||
nargs=argparse.REMAINDER) | ||
if len(sys.argv) == 1: | ||
parse_res = parser.parse_args(args) | ||
from federatedscope.core.configs.config import global_cfg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should move the import
to the top of the file
parse_res = parser.parse_args(args) | ||
from federatedscope.core.configs.config import global_cfg | ||
init_cfg = global_cfg.clone() | ||
if len(sys.argv) == 1 or parse_res.help == "all": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add some comments for these if sentences
@@ -23,7 +23,10 @@ | |||
}, | |||
"source": [ | |||
"## Configurations\n", | |||
"**FederatedScope** organize the configuration through `yacs.config.cfgNode` and can be found in `federatedscope.configs`. Please refer to the [official documentation](https://federatedscope.io/refs/index) for specific instructions on how to configure `cfg`." | |||
"**FederatedScope** organize the configuration through `core.configs.config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a formatting issue?
@@ -49,7 +49,9 @@ | |||
"For more larger datasets, please refer examples in `scripts/personalization_exp_scripts`.\n", | |||
"\n", | |||
"### Configuration\n", | |||
"**FederatedScope** organizes the configuration through an extension of `yacs.config.cfgNode`. Please refer to our [official documentation](https://federatedscope.io/docs/own-case/) for specific instructions on how to configure the initial `global_cfg` and customize your own configuration. By default, we provide built-in personalization-related configurations in `federatedscope/core/configs/`." | |||
"**FederatedScope** organizes the configuration through an extension of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
@@ -0,0 +1,600 @@ | |||
# An extended configuration system based on [yacs], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add these to LICENSE
too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please see the inline comments for minor suggestions. THX!
I made modifications according to the comments
- modified according to yuexiang's comments.
LICENSE
Outdated
Code in federatedscope/core/configs/yacs_config.py, the basic code of yacs | ||
adopts Apache 2.0 License | ||
|
||
# Copyright (c) 2018-present, Facebook, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uncomment
- modified according to yuexiang's comments
@yxdyc Here is some of my concerns:
|
Thanks for the questions. I have added de_arguments for compatibility with historical codes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we can add descriptions of configs later. Thanks!
- support help and required argument for the configs - added de-arguments for compatibility with historical codes
As the title said, now we can set argument as
And the main.py will print help info as follows:
![image](https://user-images.githubusercontent.com/67475544/183343388-114fdbb1-751e-480b-814f-fbefde58a3e4.png)