-
Notifications
You must be signed in to change notification settings - Fork 218
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
Construct FL course when server does not have data #236
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, but please see the inline comments, thanks.
else: | ||
raise ValueError('Data {} not found.'.format(config.data.type)) | ||
|
||
if config.federate.mode.lower() == 'standalone': | ||
return data, modified_config | ||
else: | ||
# Invalid data_idx | ||
if config.distribute.data_idx not in data.keys(): | ||
if config.distribute.data_idx == -1: |
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.
When data.type
is None
or ""
while distribute.data_idx
is given, we should assert in configs
.
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.
When date.type
is None or "", the distribute.data_idx
does not work. IMO, we can provide a WARNING but not an assertion here.
@@ -49,7 +49,12 @@ def extend_fl_setting_cfg(cfg): | |||
cfg.distribute.client_port = 50050 | |||
cfg.distribute.role = 'client' | |||
cfg.distribute.data_file = 'data' |
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.
The data-related keyword distribute.data_file
in distributed mode seems to be the same meaning as data.root
.
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.
data.root
is a file directory and distribute.data_file
includes the filename here
if model_config.type.lower() in ['vmfnet', 'hmfnet']: | ||
return data['train'].n_col if model_config.type.lower( | ||
) == 'vmfnet' else data['train'].n_row | ||
elif model_config.type.lower() in [ |
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.
For graph-level tasks, data is {train/val/test: DataLoader}
.
For testing: python federatedscope/main.py --cfg federatedscope/gfl/baseline/fedavg_gnn_minibatch_on_multi_task.yaml
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.
I have fixed this issue, thx!
I have rebased the thread to the master and resolved the conflicts. @rayrayraykk @yxdyc |
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.
Good Job. LGTM.
As the title says. When the server does not have data:
model.input_shape
to tell what's the input shape (a tuple) to get the model if necessary;When the server does not have data in simulation, users can set
data.type=''
. (Please see the examples in scripts/run_distributed_lr.sh)Please @rayrayraykk check
get_shape_from_data
in federatescope/core/auxiliaries/model_builder.py, thx!