diff --git a/federatedscope/core/configs/__init__.py b/federatedscope/core/configs/__init__.py index d350d81e6..6a34a00a8 100644 --- a/federatedscope/core/configs/__init__.py +++ b/federatedscope/core/configs/__init__.py @@ -13,6 +13,14 @@ if "config" in all_sub_configs: all_sub_configs.remove('config') + +from federatedscope.core.configs.config import CN, init_global_cfg +__all__ = __all__ + \ + [ + 'CN', + 'init_global_cfg' + ] + # reorder the config to ensure the base config will be registered first base_configs = [ 'cfg_data', 'cfg_fl_setting', 'cfg_model', 'cfg_training', 'cfg_evaluation' @@ -20,3 +28,4 @@ for base_config in base_configs: all_sub_configs.pop(all_sub_configs.index(base_config)) all_sub_configs.insert(0, base_config) + diff --git a/federatedscope/core/monitors/__init__.py b/federatedscope/core/monitors/__init__.py index e69de29bb..3f945b5b0 100644 --- a/federatedscope/core/monitors/__init__.py +++ b/federatedscope/core/monitors/__init__.py @@ -0,0 +1,5 @@ +from federatedscope.core.monitors.early_stopper import EarlyStopper +from federatedscope.core.monitors.metric_calculator import MetricCalculator +from federatedscope.core.monitors.monitor import Monitor + +__all__ = ['EarlyStopper', 'MetricCalculator', 'Monitor'] diff --git a/federatedscope/core/trainers/__init__.py b/federatedscope/core/trainers/__init__.py index c97dca8dc..35cce4042 100644 --- a/federatedscope/core/trainers/__init__.py +++ b/federatedscope/core/trainers/__init__.py @@ -1,15 +1,14 @@ from federatedscope.core.trainers.trainer import Trainer, GeneralTorchTrainer +from federatedscope.core.trainers.trainer_multi_model import GeneralMultiModelTrainer from federatedscope.core.trainers.trainer_pFedMe import wrap_pFedMeTrainer +from federatedscope.core.trainers.trainer_Ditto import wrap_DittoTrainer +from federatedscope.core.trainers.trainer_FedEM import FedEMTrainer from federatedscope.core.trainers.context import Context from federatedscope.core.trainers.trainer_fedprox import wrap_fedprox_trainer from federatedscope.core.trainers.trainer_nbafl import wrap_nbafl_trainer, wrap_nbafl_server __all__ = [ - 'Trainer', - 'Context', - 'GeneralTorchTrainer', - 'wrap_pFedMeTrainer', - 'wrap_fedprox_trainer', - 'wrap_nbafl_trainer', - 'wrap_nbafl_server' + 'Trainer', 'Context', 'GeneralTorchTrainer', 'GeneralMultiModelTrainer', + 'wrap_pFedMeTrainer', 'wrap_DittoTrainer', 'FedEMTrainer', + 'wrap_fedprox_trainer', 'wrap_nbafl_trainer', 'wrap_nbafl_server' ] diff --git a/federatedscope/mf/dataloader/__init__.py b/federatedscope/mf/dataloader/__init__.py index 7ceeefada..915b1c049 100644 --- a/federatedscope/mf/dataloader/__init__.py +++ b/federatedscope/mf/dataloader/__init__.py @@ -1,6 +1,3 @@ from federatedscope.mf.dataloader.dataloader import load_mf_dataset, MFDataLoader -__all__ = [ - 'load_mf_dataset', - 'MFDataLoader' -] \ No newline at end of file +__all__ = ['load_mf_dataset', 'MFDataLoader'] diff --git a/federatedscope/mf/dataset/__init__.py b/federatedscope/mf/dataset/__init__.py index ba2190acc..4c7fc0b75 100644 --- a/federatedscope/mf/dataset/__init__.py +++ b/federatedscope/mf/dataset/__init__.py @@ -1,13 +1,6 @@ from federatedscope.mf.dataset.movielens import * __all__ = [ - 'VMFDataset', - 'HMFDataset', - 'MovieLensData', - 'MovieLens1M', - 'MovieLens10M', - 'VFLMovieLens1M', - 'HFLMovieLens1M', - 'VFLMovieLens10M', - 'HFLMovieLens10M' -] \ No newline at end of file + 'VMFDataset', 'HMFDataset', 'MovieLensData', 'MovieLens1M', 'MovieLens10M', + 'VFLMovieLens1M', 'HFLMovieLens1M', 'VFLMovieLens10M', 'HFLMovieLens10M' +] diff --git a/federatedscope/mf/model/__init__.py b/federatedscope/mf/model/__init__.py index dc171c794..709fc11f9 100644 --- a/federatedscope/mf/model/__init__.py +++ b/federatedscope/mf/model/__init__.py @@ -1,9 +1,4 @@ from federatedscope.mf.model.model import BasicMFNet, VMFNet, HMFNet from federatedscope.mf.model.model_builder import get_mfnet -__all__ = [ - "get_mfnet", - "BasicMFNet", - "VMFNet", - "HMFNet" -] +__all__ = ["get_mfnet", "BasicMFNet", "VMFNet", "HMFNet"] diff --git a/federatedscope/mf/trainer/__init__.py b/federatedscope/mf/trainer/__init__.py index 7f591edde..4fc87a487 100644 --- a/federatedscope/mf/trainer/__init__.py +++ b/federatedscope/mf/trainer/__init__.py @@ -2,9 +2,6 @@ from federatedscope.mf.trainer.trainer_sgdmf import wrap_MFTrainer, init_sgdmf_ctx, embedding_clip, hook_on_batch_backward __all__ = [ - 'MFTrainer', - 'wrap_MFTrainer', - 'init_sgdmf_ctx', - 'embedding_clip', + 'MFTrainer', 'wrap_MFTrainer', 'init_sgdmf_ctx', 'embedding_clip', 'hook_on_batch_backward' -] \ No newline at end of file +] diff --git a/scripts/parse_exp_results_wandb.py b/scripts/parse_exp_results_wandb.py index ac77cfca0..5c0bab4fa 100644 --- a/scripts/parse_exp_results_wandb.py +++ b/scripts/parse_exp_results_wandb.py @@ -95,7 +95,7 @@ def main(): if res['Role'] == 'Server #': cur_round = res['Round'] res.pop('Role') - if cur_round != "Final": + if cur_round != "Final" and 'Results_raw' in res: res.pop('Results_raw') log_res = {} @@ -110,6 +110,10 @@ def main(): else: exp_stop_normal = True + if key == "Results_raw": + for final_type, final_type_dict in res["Results_raw"].items(): + for inner_key, inner_val in final_type_dict.items(): + log_res_best[f"{final_type}/{inner_key}"] = inner_val # log_res_best = {} # for best_res_type, val_dict in val.items(): # for key_inner, val_inner in val_dict.items():